Hi everyone. I just came across this thread and it addresses the exact same
problem I am having. Anne and Xinjun, I understand the different between
Document style and RPC style services. However, what I don't understand is
how to specify a serializer in the Axis client. Is there any documentation
on how to do this?
I tried adding the following code to my "XXXBindingStub" class:
qName = new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType");
cachedSerQNames.add(qName);
cls = org.w3c.dom.Document.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
However, this leads to the error "Unable to create JavaBean of type
org.w3c.dom.Document. Missing default constructor? Error was:
java.lang.InstantiationException: org.w3c.dom.Document."
This makes perfect sense since there is no default constructor for
org.w3c.dom.Document. However, what do I do now?
Sincerely,
Matt Solnit
Xinjun Chen wrote:
>
> Adnene,
>
> The following two articles may help you to understand your problem. To put
> it simple, the service style matters significantly!
> First one is Anne's explanation on RPC style and document style.
> http://searchwebservices.techtarget.com/ateQuestionNResponse/0,289625,sid26_cid494324_tax289201,00.html
>
> The second one is from IBM developerworks. It describes the service style
> and encoding very clearly.
> http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/
>
> For your problem, when you are using RPC style, the anyType works because
> in
> your request message, the actual xsd type is specify and attached in the
> request message. The server side relies on your request message (the
> acutal
> xsd type, say xsd:string, not xsd:anyType) to deserialize your XML into
> java
> object. However, in document style, the deserialization of request message
> is based on a schema. This is a contract agreed upon between the service
> client and the service provider. The representation of this agreement is
> the
> <definitions>/<types>/<schema> in the service's WSDL file.
> When you use RPC style, the server side try to find a deserializer for
> xsd:string or other type specified in the request message to deserialize
> your request message. When you switch from RPC style to Document style,
> the
> server side will try to find a deserializer for xsd:anyType from
> typemapping
> registry to deserialize the request message. However, you didn't specify
> any
> serializer/deserializer for xsd:anyType, that's why you get that
> Exception.
>
> Therefore, Anne suggest you use DOM object, say org.w3c.Document.
>
> Hope this clear your doubts.
>
>
> Regards,
> Xinjun
>
--
View this message in context:
http://www.nabble.com/-Axis-1.4--No-deserializer-for-anyType-tf1698308.html#a5948464
Sent from the Axis - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]