Re: Getting HTTP status code as 202 always and want to override with the 200.

2015-02-28 Thread Claus Ibsen
Hi

Just looked a bit in the spring-ws code and it seems they hardcode a
response to be 202, unless the response message is some kind of fault
aware, which then uses 200 instead.

There is maybe some way to customize the response code somehow. But
that would require digging into the spring-ws code.

On Wed, Feb 25, 2015 at 4:48 PM, Sag21 sagar.s...@gmail.com wrote:
 New to camel.I have existing spring application which has soap endpoints. The
 return type of soap endpoint is jdom Element.
 When the processing of endpoint completes I am calling the camel processors
 in routes - one for Acknowledgement and other for putting in JMS.
 Once its done returning me response as 202 which is correct but how to
 override that to 200.

 Tried in last processor i.e. when I put my message in JMS after that it will
 end my camel route.Tried these things 1. Used getOut 2. Used getIn. 3.Used
 after last processor in camel route.

 1.  exchange.getOut.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
 Response r = Response.status(200).entity(Created).build();
 exchange.getOut().setBody(r);

 2. exchange.getIn.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
 Response r = Response.status(200).entity(Created).build();
 exchange.getIn().setBody(r);
 3. camel:setHeader headerName =
 CamelHttpResponseCodeconstant200/constant/camel:setHeader

 When I was debugging my code after completion of camel its checking for this
  else if (exchange.getPattern().isOutCapable()) {
 Message responseMessage = exchange.getOut(Message.class);
 if (responseMessage != null) {
 Source responseBody = responseMessage.getBody(Source.class);
 WebServiceMessage response = messageContext.getResponse();


 so tried to put the few more line of code in processor to fulfil above
 request assuming my body will have Source Element.

 Message msg = exchange.getIn();
 exchange.setOut(msg)
 exchange.getOut.setBody(exchange.getIn().getBody())

 I need some pointer if someone already faced this issue. Appreciate your
 help and time.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Getting-HTTP-status-code-as-202-always-and-want-to-override-with-the-200-tp5763173.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Getting HTTP status code as 202 always and want to override with the 200.

2015-02-28 Thread Claus Ibsen
On Wed, Feb 25, 2015 at 4:48 PM, Sag21 sagar.s...@gmail.com wrote:
 New to camel.I have existing spring application which has soap endpoints. The
 return type of soap endpoint is jdom Element.
 When the processing of endpoint completes I am calling the camel processors
 in routes - one for Acknowledgement and other for putting in JMS.
 Once its done returning me response as 202 which is correct but how to
 override that to 200.

 Tried in last processor i.e. when I put my message in JMS after that it will
 end my camel route.Tried these things 1. Used getOut 2. Used getIn. 3.Used
 after last processor in camel route.

 1.  exchange.getOut.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
 Response r = Response.status(200).entity(Created).build();
 exchange.getOut().setBody(r);

 2. exchange.getIn.setHeader(Exchange.HTTP_RESPONSE_CODE,200)
 Response r = Response.status(200).entity(Created).build();
 exchange.getIn().setBody(r);

Is the code above REST code? Then that wont work with spring-ws as
that is only for SOAP/WS.

 3. camel:setHeader headerName =
 CamelHttpResponseCodeconstant200/constant/camel:setHeader

 When I was debugging my code after completion of camel its checking for this
  else if (exchange.getPattern().isOutCapable()) {
 Message responseMessage = exchange.getOut(Message.class);
 if (responseMessage != null) {
 Source responseBody = responseMessage.getBody(Source.class);
 WebServiceMessage response = messageContext.getResponse();


 so tried to put the few more line of code in processor to fulfil above
 request assuming my body will have Source Element.

 Message msg = exchange.getIn();
 exchange.setOut(msg)
 exchange.getOut.setBody(exchange.getIn().getBody())

 I need some pointer if someone already faced this issue. Appreciate your
 help and time.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Getting-HTTP-status-code-as-202-always-and-want-to-override-with-the-200-tp5763173.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: camel-blueprint.xsd is not updated

2015-02-28 Thread Willem Jiang
Hi Yogesh,

I just checked size of camel-blueprint.xsd of camel blueprint schema[1], it is 
same with the one of camel-blueprint-2.14.1.xsd.

[1]http://camel.apache.org/schema/blueprint/
--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On February 28, 2015 at 2:55:43 PM, yogu13 (yog...@gmail.com) wrote:
 Hi Willem!
  
 Looks like the camel-blueprint.xsd is updated with
 camel-blueprint-2.13.3.xsd and not with the current stable version 2.14.1
  
 Regards,
 -Yogesh
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/camel-blueprint-xsd-is-not-updated-tp5763118p5763240.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.