开发者

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,

Narendra


The 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:

  1. Create the Module Implementation
  2. Create the Handlers
  3. Create the module.xml
  4. Modify the "axis2.xml" (if you need custom phases)
  5. Modify the "services.xml" to engage modules at the deployment time.
  6. Package in a ".mar" (Module Archive)
  7. 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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜