cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krzysztof Raszkowski <raszkows...@datera.pl>
Subject How to change the value of web service invocation attributes?
Date Mon, 27 Sep 2010 09:14:25 GMT

Hi, 
we're dealing a problem with cxf interceptors. Our goal is to change the
value of web service invocation attributes. For instance we have a method
which is invoked with a string "in" and we want it changed to "out" before
we get it in out application. We use a document literal wrapped style, so
this text is a text content of the element "paramName", which is the child
of the element "methodName" inside soapBody. We were trying to write
interceptor but without any success. 

We are able to change the expected value but it is only seen in our next
interceptor (when we have two ones, one after another), but the method is
then invoked with a null value. We did it by writing a class extending
AbstractSoapInterceptor and handling a message implementing a SOAPMessage
interface (we're getting a soap body, its nodes and then changing a text
content). We expect, it should work during a pre protocol one, but we were
trying this during many phases, with no success. 

The second try was to create a class extending DepthXMLStreamReader class
and overwrite some methods for processing the XML (actually getting the
content, element name etc.). But it only works during a post stream phase in
which there is no access to the whole XML content, only to some headers. 

We were looking for the solution but each example we found was showing how
to read some values of the message (for example for logging) and it isn't a
case for us. So we'd like to ask you if it's possible to change a soap body
before web service invocation and if so, how to do it. 

The other case, if modifying is possible, is it possible to change value of
the method attribute before it's unmarshalled (but not by parsing input
stream but using SOAPMessage interface (SoapMessage cxf implementation))? If
not, what is the best way to do it? 

Thanks in advance.
-- 
View this message in context: http://cxf.547215.n5.nabble.com/How-to-change-the-value-of-web-service-invocation-attributes-tp2854897p2854974.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message