Invoking a Handler related to a specific web service call in axis2
I am using Axis2 for my webservices creation. I need to validate the received soap request(is it complain with defined xsd schema).
For this I am using Handlers in axis2.
Now my problem is that how can i specify diffrent handlers which are psecific to diffrent webservice calls(in services.xml).
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 s开发者_如何学Pythonuggestions on this regards.
Thanks,
NarendraThe common way to do what you describe is to implement a module and then to engage this module(s) in your services.xml. You can see a detailed example here: http://axis.apache.org/axis2/java/core/docs/modules.html The pocess in short is:
- Create the Module Implementation
- Create the Handlers
- Create the module.xml
- Modify the "axis2.xml" (if you need custom phases)
- Modify the "services.xml" to engage modules at the deployment time.
- Package in a ".mar" (Module Archive)
- Deploy the module in Axis2
Engaging the module in your services.xml is as simple as:
< module ref="logging" />
Please note that a module might be engaged per operation. Also note this thread: http://www.mail-archive.com/axis-user@ws.apache.org/msg06058.html
So the recommended way is to make a module with the necessary handlers and the capability to add handlers in services will be completely removed in the next release.
I hope this clears things.
Cheers!
精彩评论