You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Ruane, Conleth" <co...@hp.com> on 2004/06/23 16:14:12 UTC
Accessing Axis service using Axis client (JSP)
Hi All.
I am currently trying to migrate a SOAP client (JSP page) from Apache SOAP to Axis.
I can now successfully send and receive simple messages but I'm having a problem with the deserialization of Complex types.
This is the relevant piece of code (adapted from the Axis bidbuy sample):
//build a Call object
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
org.apache.axis.client.Call call = (org.apache.axis.client.Call)service.createCall();
// call.setTargetEndpointAddress(new java.net.URL(targetObjectURI));
call.setTargetEndpointAddress(new java.net.URL(ewsUrl));
call.setUseSOAPAction(true);
call.setSOAPActionURI("urn:ews-structs");
// register the ActionResult class
QName arqn = new QName("urn:ews-structs",
"ActionResult");
Class cls = ActionResult.class;
call.registerTypeMapping(cls, arqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
call.setOperation("putCustomer");
// call.registerTypeMapping(ActionResult.class, new QName("urn:ews-structs", "ActionResult"), BeanSerializer.class, BeanSerializer.class);
call.addParameter("sessionToken", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("customer", new QName("urn:ews-structs", "CRMCustomer"), ParameterMode.IN);
call.setReturnType( new QName("urn:ews-structs", "ActionResult"));
ar = (ActionResult)call.invoke(new Object[] {ewsToken, cust});
The error I'm getting is
"
Error: org.xml.sax.SAXException: Deserializing parameter 'putCustomerReturn': could not find deserializer for type {urn:ews-structs}ActionResult
"
I also tried it without specifying a mapping for ActionResult.
What I find odd is that the class CRMCustomer is being serialized ok (checked using tcp-tunnel) although I'm not specifying any mapping for CRMCustomer.
Any helpful suggestions are greatly appreciated.
Thanks
Con