Re: Accessing Axis service using Axis client (JSP)

"Scott Nichol" <[email protected]>
Newsgroups gmane.text.xml.soap.user
Message-ID <19e201c45926$9f84b400$6401a8c0@northgate>
I don't know the answer to either of your questions (why doesn't Axis de-serialize the return value, and how does Axis know how to serialize the CRMCustomer-type).  I suggest you give the Axis list a whirl ([email protected]).

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Ruane, Conleth" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 23, 2004 7:23 AM
Subject: 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.