Camel Endpoint Application - Webservice giving error 500 [message #1734768] |
Sat, 11 June 2016 13:27  |
Eclipse User |
|
|
|
Hi,
My question is related to using Camel Endpoint application to call a POST RESt Service.
I am having one input SDT and passing this as a JSON to service. I have selected ConvertTo as JSON. Below is my Camel config.
<setHeader headerName="CamelHttpMethod"><constant>POST</constant></setHeader>
<setHeader headerName="Content-Type">
<constant>application/json</constant>
</setHeader>
<setHeader headerName="CamelHttpUri">
<constant>${myURL}</constant>
</setHeader>
<to uri="http://isoverwritten"/>
<convertBodyTo type="java.lang.String"/>
<onException>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<setHeader headerName="Message">
<simple>$simple{property.CamelExceptionCaught.message}</simple>
</setHeader>
<simple>exception=null</simple>
<setProperty propertyName="CamelExceptionCaught">
<simple>null</simple>
</setProperty>
</onException>
However, I am always getting - HTTP operation failed invoking http://myURL with statusCode: 500.
Even though, this service perfectly fine when I call it using Postman or any REST service caller extensions.
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://myURL with statusCode: 500
at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:230)
at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:156)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)
Could you please suggest if I am missing something here.
Regards
Ajay
|
|
|
|
Powered by
FUDForum. Page generated in 0.04992 seconds