• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jaxws How to read the request in SOAPHandler?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
like
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.net.test/">
<soapenv:Header/>
<soapenv:Body>
<ws:getAccountList>
<!--Optional:-->
<userid>9999999999999</userid>
</ws:getAccountList>
</soapenv:Body>
</soapenv:Envelope>

I tried many option but no success, can anyone suggest the better approach
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
saxena vicky
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Meghana Reddy
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic