GeeCON Prague 2014*
The moose likes Web Services and the fly likes AXIS2 : Inclusion of Headers into SOAP fault message and changing the namespaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "AXIS2 : Inclusion of Headers into SOAP fault message and changing the namespaces" Watch "AXIS2 : Inclusion of Headers into SOAP fault message and changing the namespaces" New topic
Author

AXIS2 : Inclusion of Headers into SOAP fault message and changing the namespaces

raghav srinivasan
Greenhorn

Joined: Oct 18, 2009
Posts: 16
Hi ALL,

I have a query on AXIS2 and this is regarding the inclusion of customized headers into the fault message sent from the service to the client. Please find my queries described below


1. I have a INOUT message receiver in axis2 server side and now am able to send in requests with headers and after processing the same, the service is able to respond back with the same header and with the Success/Failure as response back to the client.
But when there is a SOAP fault being sent on from the service due to the results of some computations,I am not able to send the FAULT response to the client with the same headers included. Kindly let me know how to do this . One way is through a Outflow handler but it cannot add headers with dynamic values every time(picking from the request that came in),I had to look for a different approach. Below is the request response model happening

Request :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<value1> val1 </value1>
<value2> val1</value2>
</soapenv:Header>
<soapBody>
<arg1>this is a value </arg1>
<arg2>this is second value </arg2>
</soapBody>
</soaEnvelope>

Success response :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<value1> val1 </value1>
<value2> val1</value2>
</soapenv:Header>
<soapBody>
<result> success </result>
</soapBody>
</soaEnvelope>

Inevent of faults instead of the usual fault response,it should include the headers which should look like the following

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<value1> val1 </value1>
<value2> val1</value2>
</soapenv:Header>

<soapenv:Body>
<soapenv:Fault>
<faultcode/>
<faultstring/>
<detail>
<axis2ns2:SDFException xmlns:axis2ns2="http://telstra.com/sdfcore/bsc/baseSchema/v1_0">
<code>2080100</code>
<description>Sorry service denied</description>

</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


2. As you can see axis2 adds its own namespaces ( xmlns:axis2ns2) and I want to customize like xmlns:response.

Thanks in advance.. I kindly request any of you to help me with this problem.


Cheers,
Raghav.

 
GeeCON Prague 2014
 
subject: AXIS2 : Inclusion of Headers into SOAP fault message and changing the namespaces