File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Invoking a Handler specific to a operation in axis2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Invoking a Handler specific to a operation in axis2" Watch "Invoking a Handler specific to a operation in axis2" New topic
Author

Invoking a Handler specific to a operation in axis2

Narendra Kadali
Greenhorn

Joined: Nov 22, 2010
Posts: 5
Hi All,
I am using Axis2 for my webservices creation. I creates some handlers for my webservices.


I don't need to invoke this handler for every oprations.

How can specify it

For example for create user i will user a enp as http://localhost:8080/axis2/services/createUser
and for updateUser i will invoke http://localhost:8080/axis2/services/updateUser.
For each invokatioon hadlers must be different.
Can any one give any suggestions on this regards.
Thanks,
Narendra
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Narendra,

Following is an excerpt taken from IBM documentation on SOAP Message Handlers using JAX-WS. As you mentioned Axis2, I presume you are using JAX-WS based web services.

To use handlers with your server application, you must set the @HandlerChain annotation on either the service endpoint interface or the endpoint implementation class, and provide the associated handler chain configuration file. Handlers for the server are only configured by setting the @HandlerChain annotation on the service endpoint implementation or the implementation class. The handler classes must be included in the server application EAR file.


For more information, check out that link.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Narendra Kadali
Greenhorn

Joined: Nov 22, 2010
Posts: 5
Thanks for your reply.

What you mentioned here is really not necessary anotation... . I am using axis2 framework. I have to mention it in descriptor files. How to mentione in descriptor files I dont' know.



Naren Chivukula wrote:Hi Narendra,

Following is an excerpt taken from IBM documentation on SOAP Message Handlers using JAX-WS. As you mentioned Axis2, I presume you are using JAX-WS based web services.

To use handlers with your server application, you must set the @HandlerChain annotation on either the service endpoint interface or the endpoint implementation class, and provide the associated handler chain configuration file. Handlers for the server are only configured by setting the @HandlerChain annotation on the service endpoint implementation or the implementation class. The handler classes must be included in the server application EAR file.


For more information, check out that link.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Narendra,
What you mentioned here is really not necessary anotation

But, it is same. Remember Axis2 implements JAX-WS!

I outline steps to configure SOAPHandler.

1. Write your SOAPHandler class implementing javax.xml.ws.handler.soap.SOAPHandler (unless you want to use logical handler)
2. Write handler chain configuration file and name to something like handchains.xml.

3. For simplicity, place the file in the same package as your Handler class created in step 1.
4. In your end point implementation class, point to handler chain configuration file using


That's it!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Invoking a Handler specific to a operation in axis2