I'm also a beginner to Axis, using it via Eclipse 3.3. I have generated a java web client to the Oracle TaskQueryService which has an anyType to represent the payload to human task activities. I don't know yet what version of Axis is being used but I am surprised that up to this time, there is still no built-in anyType deserializer in Axis. I wonder if someone already wrote one, and if not, I will have to write a simple one myself to deserialize to a org.w3c.dom.Element. So how do I specify a deserializer through a config file?
Thanks, Rico Anne Thomas Manes wrote: > > You can specify it either programmatically or using a client-side > configuration file. > > On 8/23/06, msolnit <[email protected]> wrote: >> >> 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] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://www.nabble.com/-Axis-1.4--No-deserializer-for-anyType-tp4608778p25135366.html Sent from the Axis - User mailing list archive at Nabble.com.
