Hi,
This is in Axis2. Because of how the the pull-parsing XML object model,
AXIOM, works you may not be able to get the XML model from the generated
code. Because the generated code is not building an XML object model in
memory but only just to read the XML to deserialize it to the returned
object type for efficiency.
You could get the SOAP envelope like this
org.apache.axiom.soap.SOAPEnvelope soap =
stub._getServiceClient().getLastOperationContext().getMessageContext(
org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
Only if you make a change to the generated Stub class like this. But if you
regenerate the code this change would not stay.
Find the stub method you call for the web service. Let's say,
GetPriceResponse getPrice(GetPrice getPrice)
After existing line,
org.apache.axiom.soap.SOAPEnvelope _returnEnv =
_returnMessageContext.getEnvelope();
Add this new line.
_returnEnv.build();
(Here envelope is told to build itself the XML model)
Otherwise you should work directly with the AXIOM XML model instead of using
the generated Stub class.
See samples/quickstartaxiom
May be I'm wrong.
Upul
On 1/11/08, samanth marisetty <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am sorry I missed to say I use wsdl2java and use the java classes to
> get the response back.
>
> Thanks,
> Samanth Marisetty.
>
> On Jan 11, 2008 12:20 PM, samanth marisetty < [EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I wanted to get the response from a web service as an xml file. Please
> > let me know how it is possible.
> >
> > Thanks,
> > Samanth Marisetty.
> >
>
>