[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ksoap: ksoap 2 object parameters


Hong Huei Tay wrote:

Hi,

can you provide an example of the message format the server expects? 
Without, it is difficult to see what is going wrong.

Best,
Stefan

> Hi,
>  
> Has anyone tried sending complex objects as parameters using kSOAP 2 
> (not kSOAP 1.2) ?
>  
> Here is a section of my code:
>  
>             SoapObject person = new SoapObject("urn:type-person", "person");
>             person.addProperty("age", new Integer(21));
>             person.addProperty("married", new Boolean(true));
>             person.addProperty("name", "freakin");
>             person.addProperty("salary", new Long(5000));
>  
>             // create soap object
>             SoapObject method = new SoapObject("urn:soap-call", 
> "echoPerson");            
>             method.addProperty("person", person);
>  
>             // create envelope
>             SoapSerializationEnvelope env = new 
> SoapSerializationEnvelope(SoapEnvelope.VER10);
>             env.bodyOut = method;           
>  
>             // create http transport to send the envelope
>             HttpTransport http = new HttpTransport     
> ("http://localhost:8080/axis/services/EchoWebservice";);     
>             http.debug = true;
>  
> 
> this is the response dump:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>  <soapenv:Body>
>   <soapenv:Fault>
>    <faultcode>soapenv:Server.userException</faultcode>
>    <faultstring>org.xml.sax.SAXException: Deserializing parameter 
> &apos;person&apos;:  could not find deserializer for type 
> {urn:type-person}person</faultstring>
>    <detail/>
>   </soapenv:Fault>
>  </soapenv:Body>
> </soapenv:Envelope>
> soapenv:Server.userException
>  
> 
> Can someone help me out?
>  
> Thanks in advance
>  
>  
> 
> Tired of spam? Get advanced junk mail protection 
> <http://g.msn.com/8HMAEN/2734??PS=47575> with MSN 
> 8._______________________________________________ Ksoap mailing list 
> Ksoap@enhydra.org http://www.enhydra.org/mailman/listinfo.cgi/ksoap