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

Ksoap: Re: Ksoap: how to register java.util.Vector with classmap?


Hi JM,
I'm afraid that I never asked what you have reponded to:) If one day I 
encounter the problem you were tacking about, I'll knok the solution;)

But I sent an other question yesterday to ksoap@enhydra.org and I dis not 
received any reponse.
You may have the repsonse:

Subject: Object's attribute returned from call instead of the object itself

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="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>
  <ns1:requestInclusionResponse 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns1="http://the.uri/ws/admin";>
   <sessionID 
xsi:type="xsd:string">71EC5BB407A8AD649441A4D7D01C9848</sessionID>
   <newInclusion xsi:type="xsd:boolean">false</newInclusion>
   <relativeTime xsi:type="xsd:boolean">true</relativeTime>
  </ns1:requestInclusionResponse>
</soapenv:Body>
</soapenv:Envelope>

2) I made the following to read this response:

HttpTransport call = getNewCall("requestInclusion");
ClassMap cmap = new ClassMap();
cmap.addMapping("http://the.uri/ws/admin";, "requestInclusionResponse", new 
RequestInclusionResponse().getClass());
call.setClassMap(cmap);
Object resultObj = call.call(so);

3) And made implement to RequestInclusionResponse class the KvmSerializable 
interface.

When I debug the program, the "requestInclusionResponse" element is 
correctly mapped to the RequestInclusionResponse class and the resulting 
object is set as the body of the responseEnvelope in the HttpTransport class 
but the return from the call is a String (being the first property of the 
body of the responseEnvelope content)

WHY? PLEASE HELP!

Aldo


>From: José Manuel Castro Preciado <lomatb@yahoo.com>
>Reply-To: ksoap@enhydra.org
>To: ksoap@enhydra.org
>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.VECTOR_CLASS);
>It works for me... ;)
>
>JM
>
>
>nikita tovstoles <nikita.tovstoles@duke.edu> 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
>Ksoap@enhydra.org
>http://www.enhydra.org/mailman/listinfo.cgi/ksoap
>
>  José Manuel
>
>
>---------------------------------
>Do You Yahoo!?
>Todo lo que quieres saber de Estados Unidos, América Latina y el resto del 
>Mundo.
>Visíta Yahoo! Noticias.

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail