aspose file tools*
The moose likes Web Services and the fly likes Axis2 - Handlers for SOAP headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 - Handlers for SOAP headers" Watch "Axis2 - Handlers for SOAP headers" New topic
Author

Axis2 - Handlers for SOAP headers

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
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

Joined: Aug 26, 2008
Posts: 263
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.


SCJP 1.5(97%) My Blog
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
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

Joined: Aug 26, 2008
Posts: 263
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
 
subject: Axis2 - Handlers for SOAP headers