You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Ignat Skoryh <ig...@unisquad.com> on 2001/09/13 10:03:47 UTC

Deserialization of .NET object

Hi!

I'm trying to access .NET web service (see attached WSDL) from Apache-SOAP
client.

-== Client Java Code ==-
    call.setTargetObjectURI("http://tempuri.org/GetLinksListPagesCount");
    call.setMethodName("GetLinksListPagesCount");
    call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);

    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    IntDeserializer intSer = new IntDeserializer();
    BeanSerializer beanSer = new BeanSerializer();

    smr.mapTypes(Constants.NS_URI_LITERAL_XML,
                 new QName("http://tempuri.org/",
"GetLinksListPagesCountResult"),
                 Integer.class, null, intSer);

    smr.mapTypes(Constants.NS_URI_LITERAL_XML,
                 new QName("http://tempuri.org/",
"GetLinksListPagesCountResponse"),
                 Count.class, null, beanSer);

    Vector params = new Vector();
    params.addElement(new Parameter("PageSize", Integer.class,
           new Integer(1), Constants.NS_URI_LITERAL_XML));
    params.addElement(new Parameter("sName", String.class,
           "", Constants.NS_URI_LITERAL_XML));
    params.addElement(new Parameter("sDescription", String.class,
           "", Constants.NS_URI_LITERAL_XML));
    params.addElement(new Parameter("sURL", String.class,
           "", Constants.NS_URI_LITERAL_XML));
    params.addElement(new Parameter("approved", String.class,
           "", Constants.NS_URI_LITERAL_XML));
    call.setParams(params);
-== End Client Java Code ==-

I'm able to send messages, but get serialization exception on Client:

[SOAPException:
   faultCode=SOAP-ENV:Client;
   msg=I only know how to serialize an 'org.w3c.dom.Element'.;
   targetException=java.lang.IllegalArgumentException: I
   only know how to serialize an 'org.w3c.dom.Element'.
]

I tried different Encoding styles for setEncodingStyleURI() and
mapTypes() without any luck. What do I do wrong?

Thanks,
Ignat.