Re: help in de-serializing

[email protected] Mon, 2 Jun 2003 09:33:57 +0200
Newsgroups gmane.comp.java.enhydra.ksoap
Message-ID <[email protected]>
Hi,

I may be mistaking but :
- this construction may imply that CWWord KVMSerializable. If it still 
does not work, you can try to write a marshaller.

- your namespace declaration looks weird :
classMap.addMapping("ns1:getCWWordResponse", "CWWord", new 
CWWord().getClass());

I guess it should be instead :
classMap.addMapping("tns:CWService", "CWWord", new CWWord().getClass());

Hope it helps,
Sebastien.











"Naresh Malhotra" <[email protected]>
Sent by: 
[email protected]
2003-05-28 21:53
Please respond to ksoap

 
        To:     [email protected]
        cc:     (bcc: Sebastien Petrucci/LEU/COMP/PHILIPS)
        Subject:        Ksoap:  help in de-serializing
        Classification: 



I have not been able to de-serialize a web service xml output into a java 
object.
Any help in the right direction would be appreciated.

Executing a transport.call(SoapObject) is returning a SoapObject 
successfully.
What all do I need to do make the same call return my Java Object.

Here is what is working...

transport = new
      HttpTransportSE ("http://localhost:8080/axis/services/DictCWWS", 
"tns:CWService#getCWWord" );
     transport.debug = true;
     SoapObject rpc = new SoapObject("tns:CWService", "getWord");
     SoapObject obj = (SoapObject)transport.call(rpc);
     System.out.println("toString : " + obj.toString());
     System.out.println("property count : " + obj.getPropertyCount());

and the following code DOES NOT work
transport = new HttpTransportSE
  ( "http://localhost:8080/axis/services/DictCWWS", 
"tns:CWService#getCWWord" );
  transport.debug = true;

  classMap = new ClassMap(true);
  classMap.addMapping("ns1:getCWWordResponse", "CWWord", new 
CWWord().getClass());
  transport.setClassMap( classMap );
  CWWord cwWord = (CWWord) transport.call(rpc);

I am getting a class cast exception on the above line...
1. Is there anything dumb I am doing in the addMapping call ?
2. CWWord.class which is in my classpath... does it have to implment 
KVMSeri.... interface.. I think I have even tried that without success.

Please help!

- Naresh

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

_______________________________________________
Ksoap mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/ksoap