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 Kent Schmidt <Ke...@paxonix.com> on 2006/11/22 15:14:24 UTC
How to Configure SOAP Response to Web Service Call?
How do I define the format of the SOAP response to the incoming web
service call? I determined how to use WSDL and services.xml to correctly
define the format of the incoming message, but the outgoing response has
several elements I didn't ask for. My Axis2/AXIOM web service looks like
this
public static synchronized OMElement response( final OMElement
pRequest )
{
// do some processing on pRequest
OMElement soapResponse = null ;
MyKindOfObject myResponseObject = new MyKindOfObject() ;
jaxbContext = ... ;
SAXOMBuilder builder = new SAXOMBuilder();
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.marshal( myResponseObject, builder );
soapResponse = builder.getRootElement();
return soapResponse;
}
The SOAP response I get back is:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ns:paxintegrationResponse
xmlns:ns="http://services.paxonix.com/integration
Server">
<return>
<paxintegration:paxintegrationresults
xmlns:paxintegration="http://servi
ces.paxonix.com/integrationServer">
<paxintegration:status>
<paxintegration:statuscode>001</paxintegration:statuscode>
</paxintegration:status>
</paxintegration:paxintegrationresults>
</return>
</ns:paxintegrationResponse>
</soapenv:Body>
</soapenv:Envelope>
The basic format of the SOAP response is correct, but there are
extraneous elements <paxintegrationResponse> and <return>; where are
they coming from and how do I remove them?
Thanks!
Kent Schmidt
Paxonix, Inc.
Re: How to Configure SOAP Response to Web Service Call?
Posted by keith chapman <ke...@gmail.com>.
May b its defined in the schema of the wsdl. It would be easy to look into
this if you can attach your wsdl.
Thanks,
Keith
On 11/22/06, Kent Schmidt <Ke...@paxonix.com> wrote:
>
> How do I define the format of the SOAP response to the incoming web
> service call? I determined how to use WSDL and services.xml to correctly
> define the format of the incoming message, but the outgoing response has
> several elements I didn't ask for. My Axis2/AXIOM web service looks like
> this
>
>
>
> public static synchronized OMElement response( final OMElement
> pRequest )
>
> {
>
> // do some processing on pRequest
>
>
>
> OMElement soapResponse = null ;
>
> MyKindOfObject myResponseObject = new MyKindOfObject() ;
>
> jaxbContext = … ;
>
> SAXOMBuilder builder = new SAXOMBuilder();
>
> Marshaller marshaller = jaxbContext.createMarshaller();
>
> marshaller.marshal( myResponseObject, builder );
>
>
>
> soapResponse = builder.getRootElement();
>
>
>
> return soapResponse;
>
> }
>
>
>
> The SOAP response I get back is:
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> ">
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
> * *
>
> * <ns:paxintegrationResponse xmlns:ns="
> http://services.paxonix.com/integration*
>
> *Server">*
>
> * <return>*
>
>
>
> <paxintegration:paxintegrationresults xmlns:paxintegration="
> http://servi
>
> ces.paxonix.com/integrationServer">
>
> <paxintegration:status>
>
> <paxintegration:statuscode>001</paxintegration:statuscode>
>
> </paxintegration:status>
>
> </paxintegration:paxintegrationresults>
>
>
>
> * </return>*
>
> * </ns:paxintegrationResponse>*
>
>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
>
>
> The basic format of the SOAP response is correct, but there are extraneous
> elements <paxintegrationResponse> and <return>; where are they coming from
> and how do I remove them?
>
>
>
>
>
> Thanks!
>
>
>
> Kent Schmidt
>
> Paxonix, Inc.
>
Re: How to Configure SOAP Response to Web Service Call?
Posted by Kinichiro Inoguchi <in...@yahoo.com>.
Hi
Do you use RPCMessageReceiver ?
If you need to create SOAP body as you like,
how about using RawXMLINOutMessageReceiver.
kinichiro
--- Kent Schmidt <Ke...@paxonix.com> wrote:
> How do I define the format of the SOAP response to the incoming web
> service call? I determined how to use WSDL and services.xml to
> correctly
> define the format of the incoming message, but the outgoing response
> has
> several elements I didn't ask for. My Axis2/AXIOM web service looks
> like
> this
>
>
>
> public static synchronized OMElement response( final OMElement
> pRequest )
>
> {
>
> // do some processing on pRequest
>
>
>
> OMElement soapResponse = null ;
>
> MyKindOfObject myResponseObject = new MyKindOfObject() ;
>
> jaxbContext = ... ;
>
> SAXOMBuilder builder = new SAXOMBuilder();
>
> Marshaller marshaller = jaxbContext.createMarshaller();
>
> marshaller.marshal( myResponseObject, builder );
>
>
>
> soapResponse = builder.getRootElement();
>
>
>
> return soapResponse;
>
> }
>
>
>
> The SOAP response I get back is:
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
>
>
> <ns:paxintegrationResponse
> xmlns:ns="http://services.paxonix.com/integration
>
> Server">
>
> <return>
>
>
>
> <paxintegration:paxintegrationresults
> xmlns:paxintegration="http://servi
>
> ces.paxonix.com/integrationServer">
>
> <paxintegration:status>
>
>
> <paxintegration:statuscode>001</paxintegration:statuscode>
>
> </paxintegration:status>
>
> </paxintegration:paxintegrationresults>
>
>
>
> </return>
>
> </ns:paxintegrationResponse>
>
>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
>
>
> The basic format of the SOAP response is correct, but there are
> extraneous elements <paxintegrationResponse> and <return>; where are
> they coming from and how do I remove them?
>
>
>
>
>
> Thanks!
>
>
>
> Kent Schmidt
>
> Paxonix, Inc.
>
>
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org