Reputation: 2800
Say I have a WCF service consumed by jaxws soap generated client using wsimport. Service SEI looks like
@WebMethod(operationName = "DoSomething", action = "http://mydomain.com/PersonService/Dosomething")
@WebResult(name = "DoSomethingResult", targetNamespace = "http://mydomain.com/")
@RequestWrapper(localName = "DoSomething", targetNamespace = "http://mydomain.com/", className = "webservice.jaxws.DoSomething")
@ResponseWrapper(localName = "DoSomethingResponse", targetNamespace = "http://mydomain.com/", className = "webservice.jaxws.DoSomething")
public Person doSomething(
@WebParam(name = "person", targetNamespace = "http://mydomain.com/")
Person person);
that takes a complex type Person and return same type Person and generated DoSomething looks like
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"person"
})
@XmlRootElement(name = "DoSomething")
public class DoSomething {
@XmlElement(nillable = true)
protected Person person;
public Person getPerson() {
return person;
}
public void setPerson(Person value) {
this.person = value;
}
everything works fine if Person is same package as DoSomething, as soon as I move Person somewhere else, WCF service cannot get anything out of Person object( fields are either null or 0) , the return value from WCF cannot be deserilized correctly by JAXWS, although there were no exception.
I noticed if they are in the same package, then setPerson will be called but not if they are in different packages.
I am wondering is it possible to put the complex type Person in a different package as DoSomething.
Upvotes: 1
Views: 728
Reputation: 2800
It turns out need the magical package-info.java file within Person's package
Upvotes: 1