Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis handler question

 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to call a webservice which has 3 different methods. When I call a method, I want to be able to intercept the SOAP message that is being send to the webservice.

At the moment I have all the pieces:

- I have the handler class which extracts the SOAP message being sent
- I can (in code) configure my stub so that it calls the handler once I invoke one of the three methods.

The problem is that I can only register the handler for the entire WebService port, and not per method. This means that the same handler is called regardless of the method I call on the WebService.
The thing I want is that I configure a separate handler per method, and not for the entire Webservice...

Code:



(MyLogHandler is a java RPC handler)

-------------------
It seems that I can also solve this by creating 3 locator instances and 3 service instances. I can then configure each locator with a different handler. When I use service 2 to call method 2, then handler 2 is invoked. Of course, if I call method 1 on service 2, handler 2 is also invoked. But this seems a rather dirty solution, there must be something better ?
-------------------

Thanks a lot !
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't configure handlers on a per-method basis, but you can find out which service and operation is invoked with code as described here. Then you can simply exit the handler if the call is not meant for the method you're interested in.
 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thanks, that was helpfull
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!