Sorry see the following was trying to simplify the question. I have a
WSDLFile and it has generated the stubs for me. However, I need to take XML
that I know represents these objects and deserialise it into these objects
to return from my method.

The following code takes the generated apache axis objects for the SRW
explainResponse, returned from the RPC call invoked through axis and
serialises them out to XML

// obtain the serialiser to return this to XML
QName explainQName = new QName("http://www.loc.gov/zing/srw/";,
"explainResponse");
Serializer responseSer = ExplainResponseType.getSerializer(null,
ExplainResponseType.class, explainQName);

StringWriter responseWriter = new StringWriter();
SerializationContext context = new SerializationContext(responseWriter);
context.setPretty(false);
responseSer.serialize(explainQName, null, response, context);

String SRWResult = responseWriter.getBuffer().toString();
            
This code all works perfectly fine, my problem is that I now need to do the
reverse operation and wish to use the axis generated classes.

Points to note:

In the example above axis binding stubs were invoked first, the server
called and the serialisation performed on the returned objects from axis
In this scenario this will not have happened I just want to use the
deserialisation code generated by axis to recreate the objects from XML and
not invoke any RPC calls/ binding stub code, hence I’m concerned that some
of the QNames may not have been registered correctly for the process to work

So with these in mind I know I must at least do the following

QName explainQName = new QName("http://www.loc.gov/zing/srw/",";
explainResponse ");
Deserializer ser = ExplainResponseType.getDeserializer(null,
ExplainResponseType.class, explainQName);

However, what do I need to now to turn my XML back into a fully populated
ExplainResponseType object?

Regards

Andy Foster



-----Original Message-----
From: Nicolas De Loof [mailto:[EMAIL PROTECTED] 
Sent: 26 January 2006 11:20
To: [email protected]
Subject: Re: Deserialisation


WSDL2Java can only run from ... a WSDL !
A "sample" XML message doesn't describe a web service.
WSDL is a service description language (itself beeing an XML document).

If your are web-service client, you have to ask your service for it's WSDL.
Some web service serveurs (as axis) follow the unofficial rule to 
generate WSDL for request : http://server/services/myService?wsdl,
perhaps it may give you the expected WSDL.

Nico.

Andy Foster a écrit :

>Hi all,
>
>If you have the XML representation of your axis response message already
how
>can you use the WSDL2Java generated classes to deserialise your XML(which
is
>currently a String) into those generated java classes.
>
>The XML is only the body XML not the full soap message.
>
>Regards
>
>Andy Foster
>  
>

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient,  you are not
authorized to read, print, retain, copy, disseminate,  distribute, or use
this message or any part thereof. If you receive this  message in error,
please notify the sender immediately and delete all  copies of this message.



Reply via email to