Hi, You can setup the response from the SOAPFault setStatusCode method. Just like this: SoapFault sf = new SoapFault("Central svarer ikke hos " + central, SoapFault.FAULT_CODE_SERVER); sf.setStatusCode(504);
-- 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 March 9, 2015 at 5:59:56 PM, Frankiboy (mail.to.fra...@gmail.com) wrote: > When my endpoint is down, i want to create a soap fault, and set the reponse > code to 504. > > What you cant see, is that on the endpoint have a: > "?throwExceptionOnFailure=false" > > > My Route: > > from("direct:channel2").onException(Exception.class).handled(true). > process(new > LogError(HubConstants.CHANNEL2.getValue())).end() > .recipientList() > .method(Util.class, "getEndpoint"); > > > When the endpoint is down, i come into my exception.class, where i have > this code: > > exchange.removeProperty(Exchange.EXCEPTION_CAUGHT); > > exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 504); > exchange.getOut().setFault(true); > SoapFault sf = new SoapFault("Central svarer ikke hos " + central, > SoapFault.FAULT_CODE_SERVER); > > > The client get the soap fault , but the reponse code is 500, and NOT 504... > > Can anyone tell me whats wrong here ? > > Frank > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-setHeader-reponse-code-tp5763820.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >