ksoap 2 object parameters
"Hong Huei Tay" <[email protected]> Thu, 27 May 2004 16:20:04 +0000
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <[email protected]> |
<html><div style='background-color:'><DIV class=RTE>Hi,</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Has anyone tried sending complex objects as parameters using kSOAP 2 (not kSOAP 1.2) ? </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Here is a section of my code:</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> SoapObject person = new SoapObject("urn:type-person", "person");<BR> person.addProperty("age", new Integer(21));<BR> person.addProperty("married", new Boolean(true));<BR> person.addProperty("name", "freakin");<BR> person.addProperty("salary", new Long(5000));</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> // create soap object <BR> SoapObject method = new SoapObject("urn:soap-call", "echoPerson"); <BR> method.addProperty("person", person);</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> // create envelope<BR> SoapSerializationEnvelope env = new SoapSerializationEnvelope(SoapEnvelope.VER10);<BR> env.bodyOut = method; </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> // create http transport to send the envelope<BR> HttpTransport http = new HttpTransport ("<A href="http://localhost:8080/axis/services/EchoWebservice">http://localhost:8080/axis/services/EchoWebservice</A>"); <BR> http.debug = true;</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><BR>this is the response dump:</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><?xml version="1.0" encoding="UTF-8"?><BR><soapenv:Envelope xmlns:soapenv="<A href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</A>" xmlns:xsd="<A href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>" xmlns:xsi="<A href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"><BR> <soapenv:Body><BR> <soapenv:Fault><BR> <faultcode>soapenv:Server.userException</faultcode><BR> <faultstring>org.xml.sax.SAXException: Deserializing parameter &apos;person&apos;: could not find deserializer for type {urn:type-person}person</faultstring><BR> <detail/><BR> </soapenv:Fault><BR> </soapenv:Body><BR></soapenv:Envelope><BR>soapenv:Server.userExcepti
on</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE><BR>Can someone help me out? </DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE>Thanks in advance</DIV>
<DIV class=RTE> </DIV>
<DIV class=RTE> </DIV></div><br clear=all><hr>Tired of spam? Get <a href="http://g.msn.com/8HMAEN/2734??PS=47575">advanced junk mail protection</a> with MSN 8.</html>