You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Martin Fernau <m....@cps-net.de> on 2009/08/07 15:56:32 UTC

Possibility to marshal the request-Parameter to XML?

Hi Everyone!

Following question:

Lets assume that I have a wsdl-File.
Say further I already did the wsdl2java step successfully.
Now I have one Service-Class with the following structure:

public MethodResponse1 method1(MethodRequest1 request)
...
public MethodResponse2 method2(MethodRequest2 request)
...
and so on

Is there a way to marshal those Request-Objects back to XML and is there a way 
to unmarshal a Response-Object from an already existing XML?


Background:
My Service is just an interface between an old cobol program on one side and 
the SOAP-Client on the other side. The SOAP-Client is calling my Service and 
want to comunicate with me. But I need to transfer the informations to the 
cobol-program which do the business things.
The easiest way would be to stream the Request-Informations back to XML. The 
cobol program can read this and itself answering with XML. The answer-XML is 
the Response-Objekt I just need to read and put into such an Object and 
finally return my Method. Would be nice to have a build-in method to stream 
these Object in and out of XML. 
The hard way is to generate the same Classes with the JAXB compiler and 
manually 1:1 copy the informations from the axis objects to the JAXB objects. 
Then I would able to do the marshalling and unmarshalling thing with JAXB.

Re: Possibility to marshal the request-Parameter to XML?

Posted by Martin Fernau <m....@cps-net.de>.
Hello Andreas,

sorry for my late answer. 
This helped my a lot. Thanks for your help! Sometimes the answer is easier as 
I think....

Martin

Am Samstag 08 August 2009 schrieb Andreas Veithen:
> Martin,
>
> You can do this using RawXMLINOutMessageReceiver. It should be easy to
> find examples on the Web that show how to use this class.
>
> Andreas
>
> On Fri, Aug 7, 2009 at 20:33, Martin Fernau<m....@cps-net.de> wrote:
> > Hmm, I don't know. Maybe I'm not deep enough into this thematic.
> > But how can I use axis2 without databinding then? And what does this mean
> > for my service class?
> >
> > Am Freitag 07 August 2009 schrieb Andreas Veithen:
> >> Martin,
> >>
> >> If that is the requirement, why do you use databinding at all?
> >>
> >> Andreas

Re: Possibility to marshal the request-Parameter to XML?

Posted by Andreas Veithen <an...@gmail.com>.
Martin,

You can do this using RawXMLINOutMessageReceiver. It should be easy to
find examples on the Web that show how to use this class.

Andreas

On Fri, Aug 7, 2009 at 20:33, Martin Fernau<m....@cps-net.de> wrote:
> Hmm, I don't know. Maybe I'm not deep enough into this thematic.
> But how can I use axis2 without databinding then? And what does this mean for
> my service class?
>
> Am Freitag 07 August 2009 schrieb Andreas Veithen:
>> Martin,
>>
>> If that is the requirement, why do you use databinding at all?
>>
>> Andreas
>
>

Re: Possibility to marshal the request-Parameter to XML?

Posted by Martin Fernau <m....@cps-net.de>.
Hmm, I don't know. Maybe I'm not deep enough into this thematic. 
But how can I use axis2 without databinding then? And what does this mean for 
my service class?

Am Freitag 07 August 2009 schrieb Andreas Veithen:
> Martin,
>
> If that is the requirement, why do you use databinding at all?
>
> Andreas


Re: Possibility to marshal the request-Parameter to XML?

Posted by Andreas Veithen <an...@gmail.com>.
Martin,

If that is the requirement, why do you use databinding at all?

Andreas

On Fri, Aug 7, 2009 at 15:56, Martin Fernau<m....@cps-net.de> wrote:
> Hi Everyone!
>
> Following question:
>
> Lets assume that I have a wsdl-File.
> Say further I already did the wsdl2java step successfully.
> Now I have one Service-Class with the following structure:
>
> public MethodResponse1 method1(MethodRequest1 request)
> ...
> public MethodResponse2 method2(MethodRequest2 request)
> ...
> and so on
>
> Is there a way to marshal those Request-Objects back to XML and is there a way
> to unmarshal a Response-Object from an already existing XML?
>
>
> Background:
> My Service is just an interface between an old cobol program on one side and
> the SOAP-Client on the other side. The SOAP-Client is calling my Service and
> want to comunicate with me. But I need to transfer the informations to the
> cobol-program which do the business things.
> The easiest way would be to stream the Request-Informations back to XML. The
> cobol program can read this and itself answering with XML. The answer-XML is
> the Response-Objekt I just need to read and put into such an Object and
> finally return my Method. Would be nice to have a build-in method to stream
> these Object in and out of XML.
> The hard way is to generate the same Classes with the JAXB compiler and
> manually 1:1 copy the informations from the axis objects to the JAXB objects.
> Then I would able to do the marshalling and unmarshalling thing with JAXB.
>