Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking a Handler specific to a operation in axis2

 
Narendra Kadali
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Narendra Kadali
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic