• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic