Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis2 - Handlers for SOAP headers

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a service created using contract first approach in Axis2.

Now the client, needs to pass header information to this service with the user credentials. Only if the user is valid the service call should succeed. Otherwise a fault should be raised.
To add information to header (in the request), I have created the following handler-chain.xml


and the following handler on the client side



but this header is not getting called. Seems it is not able to locate the handler-chain.xml

Can someone please let me know how to correct this.

Thank you

 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anjali,

You are not using axis2 handler. To qualify as asix2 handler either you have to extend and AbstactHandler or implement handler. And then you need to register it in axis2.config(inside phase) to make sure it's getting picked.
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivendra tripathi wrote:Anjali,

You are not using axis2 handler. To qualify as asix2 handler either you have to extend and AbstactHandler or implement handler. And then you need to register it in axis2.config(inside phase) to make sure it's getting picked.


Thank you.
Where can I find the axis2.config file? Are you referring to Axis2.xml

If you are referring to Axis2.xml, then under which phase should I put my handler.


 
shivendra tripathi
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have implemented a simple handler for adding soap headers. Find below the changes needed.

This is my handler.


Changes done in axis2.xml


Following is my soap envelope



 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic