You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "raulvk.soa" <ra...@gmail.com> on 2009/02/10 00:11:54 UTC

Capturing servicemix-http Status Code

Hi,

We need to use the servicemix-http in a peculiar InOut fashion for calling
out a synchronous Servlet. This Servlet will NOT return any XML content in
the response, but simply a HTTP status code.

The returned HTTP status code will vary depending on whether the invocation
was correct or not, so we need to capture and act upon it. More
specifically, we need to build an XML message depending on the status code. 

How can we look into the returned HTTP status code? Does the servicemix-http
component store it in a message header of the Out message?

Ideally, even if the invocation returned a status code other than 200 or
202, it should be treated as a normal Out message instead of a Fault.

Many thanks!

-- 
View this message in context: http://www.nabble.com/Capturing-servicemix-http-Status-Code-tp21924292p21924292.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Capturing servicemix-http Status Code

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Using the new HTTP endpoints you can define your own marshaler. In the marshaler,
you have access to the HttpServletRequest and HttpServletResponse, so you can
get the status code and use it to populate a message.

You have an example how to write your marshaler in the TIP section.
http://servicemix.apache.org/servicemix-http-new-endpoints.html

You have an example of a marshaler to blacklist/whitelist IP addresses.

Regards
JB

On Monday 09 February 2009 - 15:11, raulvk.soa wrote:
> 
> Hi,
> 
> We need to use the servicemix-http in a peculiar InOut fashion for calling
> out a synchronous Servlet. This Servlet will NOT return any XML content in
> the response, but simply a HTTP status code.
> 
> The returned HTTP status code will vary depending on whether the invocation
> was correct or not, so we need to capture and act upon it. More
> specifically, we need to build an XML message depending on the status code. 
> 
> How can we look into the returned HTTP status code? Does the servicemix-http
> component store it in a message header of the Out message?
> 
> Ideally, even if the invocation returned a status code other than 200 or
> 202, it should be treated as a normal Out message instead of a Fault.
> 
> Many thanks!
> 
> -- 
> View this message in context: http://www.nabble.com/Capturing-servicemix-http-Status-Code-tp21924292p21924292.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré (Nanthrax)
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net
jb@nanthrax.net
PGP : 17D4F086