My Requirement is to read the soap request in SOAPHandler, look out for some particular elements in the request and take some action based on element value.
I can get any type of request, but I will lookout for “userid” element in the request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.net.test/">
I tried many option but no success, can anyone suggest the better approach
Did you try implementing the LogicalHandler which provides access to the SOAP payload (body) regardless of the transport used.
For an example of using LogicalHandler , you can look at the ServerLogicalHandlerBase.java here
BTW, Which framework are you using? CXF, Spring, Axis2 ?
Joined: Sep 05, 2005
I am using JAX WS, I want to know is there any way to get the element from the request, the way we do in DOM tree to get element by the name.
I didnt find any api in Handlers.
The approcah which i followed is to convert the request into the string xml and then creating the DOM object with the string xml and then looked for the first node and searched for the element, It worked but I am not convinced with this approach, this will hit the performance.
I want direct api to access the element from the request.
Joined: Jan 29, 2002
If you look at the example in the link that I provided
You can get a Source object on which you directly apply XSL transformation using the TrAX API which is described here