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

Ksoap: ksoap2 object parameter


 
Thanks Michael for your example, but can your provide a simpler one?
 
Questions:
1. From my code example, how can it be fixed to work ?
2. Can a SoapObject contain another SoapObject as a property (request parameter)?
 
The codes:
 
            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
 
 
I hope there's a simpler way to achieve this
 
Thanks again in advance
 
 


The new MSN 8: smart spam protection and 2 months FREE*