我正在运行servicemix 4.4.1。我正在尝试使用camel-http4对一个网站进行http调用。无论我尝试调用哪个网站,我都会收到这个错误: org.apache.camel.component.http.HttpOperationFailedException: org.apache.camel.RuntimeCamelException操作调用http://servicemix.apache.org/downloads/servicemix-4.4.0.html失败,statusCode: 405
下面是我的代码片段:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq://events1"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://servicemix.apache.org/downloads/servicemix-4.4.0.html"/>
<to uri="log:events"/>
</route>
</camelContext>
我已经尝试了许多网站,并尝试使用不同的http方法(post和get),但我总是收到相同的错误。有什么想法吗?提前谢谢。
发布于 2012-07-01 03:41:27
我对此进行了检查;通过设置选项‘bridgeEndpoint’解决了问题;您正在将http端点设置为bridgeEndpoint,这意味着请求url将使用请求URI进行更新。
<route>
<from uri="-------"/>
<to uri="jetty://http://localhost:9090/my.html?bridgeEndpoint=true"/
<to uri="log:events"/>
</route>
https://stackoverflow.com/questions/9756879
复制相似问题