Re: Ksoap: how to register java.util.Vector with classmap?
"Wysocki Adalbert" <[email protected]> Wed, 03 Mar 2004 20:08:53 +0000
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <[email protected]> |
Hi JM, I'm afraid that I never asked what you have reponded to:) If one day I=20 encounter the problem you were tacking about, I'll knok the solution;) But I sent an other question yesterday to [email protected] and I dis not= =20 received any reponse. You may have the repsonse: Subject: Object's attribute returned from call instead of the object itse= lf Hi, You are my last chance;) I'm trying to get work the following scenario: 1) This is the reponse from my axis server: <?xml version=3D"1.0" encoding=3D"UTF-8"?> <soapenv:Envelope xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelo= pe/"=20 xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20 xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:requestInclusionResponse=20 soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/"=20 xmlns:ns1=3D"http://the.uri/ws/admin"> <sessionID=20 xsi:type=3D"xsd:string">71EC5BB407A8AD649441A4D7D01C9848</sessionID> <newInclusion xsi:type=3D"xsd:boolean">false</newInclusion> <relativeTime xsi:type=3D"xsd:boolean">true</relativeTime> </ns1:requestInclusionResponse> </soapenv:Body> </soapenv:Envelope> 2) I made the following to read this response: HttpTransport call =3D getNewCall("requestInclusion"); ClassMap cmap =3D new ClassMap(); cmap.addMapping("http://the.uri/ws/admin", "requestInclusionResponse", ne= w=20 RequestInclusionResponse().getClass()); call.setClassMap(cmap); Object resultObj =3D call.call(so); 3) And made implement to RequestInclusionResponse class the KvmSerializab= le=20 interface. When I debug the program, the "requestInclusionResponse" element is=20 correctly mapped to the RequestInclusionResponse class and the resulting=20 object is set as the body of the responseEnvelope in the HttpTransport cl= ass=20 but the return from the call is a String (being the first property of the= =20 body of the responseEnvelope content) WHY? PLEASE HELP! Aldo >From: Jos=E9 Manuel Castro Preciado <[email protected]> >Reply-To: [email protected] >To: [email protected] >Subject: Re: Ksoap: how to register java.util.Vector with classmap? >Date: Wed, 3 Mar 2004 11:01:42 -0600 (CST) > >Hi.. > >I had a similar problem... try with: > >cm.addMapping("http://xml.apache.org/xml-soap","Vector",ElementType.VECT= OR_CLASS); >It works for me... ;) > >JM > > >nikita tovstoles <[email protected]> wrote: > >Hi, > >i'm trying to send a vector of object via kSOAP. As the FAQ suggests, >i'm using java.util.Vector class as the method parameter. As i >understand, kSOAP does not "know" of that class by default, so i have to >register it with classmap. but what exactly should be the namespace and >name used: > >classMap.addMapping("http://schemas.xmlsoap.org/soap/encoding/", >"Vector", Vector.class)? > > >Or is that not possible and i have to create a subclass of vector >implementing kvm serializable and register it (which would really suck >of course:)? > >thanks >-nikita > >_______________________________________________ >Ksoap mailing list >[email protected] >http://www.enhydra.org/mailman/listinfo.cgi/ksoap > > Jos=E9 Manuel > > >--------------------------------- >Do You Yahoo!? >Todo lo que quieres saber de Estados Unidos, Am=E9rica Latina y el resto= del=20 >Mundo. >Vis=EDta Yahoo! Noticias. _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* =20 http://join.msn.com/?page=3Dfeatures/junkmail