This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Can Message Handlers modify SOAP Body ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can Message Handlers modify SOAP Body ?

I remember reading that SOAP intermediaries (a.k.a Message Handlers) cannot change the Body part of a SOAP Message.

Please correct me if I am wrong. I am confused after reading "Handler Scenarios" in MZ's guide that says Handlers must be able to transform just parts of the body.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JAX-RPC 1.1 specification on page 106 states:


The handleRequest, handleResponse and handleFault methods for a SOAP message
handler get access to the SOAPMessage from the SOAPMessageContext. The
implementation of these methods can modify the SOAPMessage including the headers and body elements.

 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, Valentin !

In the mean time, I cross-checked with the book "J2EE Web Services" by Richar Monson-Haefel. It says

Neither SOAP 1.1 nor the BP explicity prohibits intermediaries from modifying the contents of the Body element. As a result, the ultimate reciever has no way of knowing if the application specific data has changed somewhere along the message path. SOAP 1.2 reduces this uncertainty by explictly prohibiting certain intermediaries, called forwarding intermediaries, from changing the contents of the Body element and recommeding that all other intermediaries, called active intermiediaries, use a header block to document any chances to the Body element.



So, looks like JAX-RPC message handlers fall under "active intermediaries". Any idea if JAX-RPC Message handlers can be mde "forwarding intermediaries" ?
 
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the purpose of this exam, you should only consider SOAP 1.1, and thus, there is no need to make any disctinction between "active intermediaries" and "forwarding intermediaries"
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In reality, it is not uncommon to find message handlers manipulating the body. Repsponse caching is one example where a handler caches outgoing responses( in handleResponse ) and uses the cached responses to intelligently parse the incoming message( in handleRequest ). If match found, the handleRequest can either tag the SOAP body with response as the hint to the ultimate receiver, or even better, simply send the response back to the client skipping actual end point invocation.

HTH.
 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith -

As you say
"If match found, the handleRequest can either tag the SOAP body with response as the hint to the ultimate receiver, or even better, simply send the response back to the client skipping actual end point invocation."

can you please explain this sentence clearly ...
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic