• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Can Message Handlers modify SOAP Body ?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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 ...
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic