I have a client set up which calls an external WS. The body of the SOAP
response I get is:
<soap:Body>
<LoginResponse xmlns="http://myexample.com">
<LoginResult>
<id>9</id>
<key>12345</key>
</LoginResult>
</LoginResponse>
</soap:Body>
The interface I've set up to model the operation is:
/**
* @@WebService("Partners")
*/
public interface IPartners {
/**
* @@WebMethod(operationName = "Login",
action="http://myexample.com/Login")
* @@.username WebParam("username")
* @@.password WebParam("password")
* @@.return WebResult("LoginResponse")
*/
public LoginResult login(String username, String password);
}
However, the LoginResult object:
public class LoginResult {
private int id;
private String key;
... getters and setters
}
is never populated with the values from the SOAP body.
I'm calling the web service using the following:
<snip>
XFire xfire = XFireFactory.newInstance().getXFire();
TypeMappingRegistry registry = new DefaultTypeMappingRegistry();
AnnotationServiceFactory factory = new
AnnotationServiceFactory(xfire.getTransportManager());
Service service = factory.create(IPartners.class, "Partners",
"http://myexample.com", null);
xfire.getServiceRegistry().register(service);
IPartners serviceToCall = (IPartners) new
XFireProxyFactory().create(service, "http://localhost:50/Partners.asmx");
LoginResult ls = serviceToCall.login("theUsername", "thePassword");
</snip>
I'm bound to using Java 1.4 and I've used commons annotations, as I need to
populate SOAPaction into the HTTP header (which I could not get to work with
Aegis bindings).
What step am I missing? Do I need to use some annotations on the
LoginResult class?
Thanks in advance,
Matt
--
View this message in context:
http://www.nabble.com/Unmarshalling-with-Commons-Annotations-tf3871884.html#a10969841
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email