Camel:jetty作为输入,soap作为输出
我想用camel编写一个简单的代码,将URL侦听器重定向到soap web服务。 我有一个简单的PHP helloWorld SOAP web服务可用。我想输入Camel:jetty作为输入,soap作为输出,soap,routing,jetty,http-status-code-404,apache-camel,Soap,Routing,Jetty,Http Status Code 404,Apache Camel,我想用camel编写一个简单的代码,将URL侦听器重定向到soap web服务。 我有一个简单的PHP helloWorld SOAP web服务可用。我想输入http://localhost:8080/test并被路由到外部SOAP web服务。 最终目标是将soap转换为REST/JSON 以下是我的camel-context.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="h
http://localhost:8080/test
并被路由到外部SOAP web服务。
最终目标是将soap转换为REST/JSON
以下是我的camel-context.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:camel="http://camel.apache.org/schema/spring" xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<cxf:cxfEndpoint id="helloEp"
address="http://test.mydomain.com/soap/hello.php"
serviceClass="com.seb.helloEndPoint"
wsdlURL="http://test.mydomain.com/soap/hello.php?wsdl"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<package>com.seb</package>
<route>
<from uri="jetty://http://0.0.0.0:8080/test"/>
<to uri="cxf:bean:helloEp"/>
</route>
</camelContext>
</beans>
但是当我输入http://127.0.0.1:8080/test
在我的web浏览器中,我有一个“无法加载页面”空白页面。我还在http://127.0.0.1:8080/test
和同一问题(未能加载外部实体“http://127.0.0.1:8080/test
”)
谁能解释我做错了什么
谢谢 有几件事。打开跟踪并查看日志。我很确定你的问题在cxf方面
<camelContext trace="true" xmlns="http://activemq.apache.org/camel/schema/spring">
您还需要在端点中指定更多细节,如本例所示
<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort"
wsdlURL="testutils/hello_world.wsdl"
serviceClass="org.apache.hello_world_soap_http.Greeter"
endpointName="s:SoapPort"
serviceName="s:SOAPService"
xmlns:s="http://apache.org/hello_world_soap_http" />
两件事。打开跟踪并查看日志。我很确定你的问题在cxf方面
<camelContext trace="true" xmlns="http://activemq.apache.org/camel/schema/spring">
您还需要在端点中指定更多细节,如本例所示
<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort"
wsdlURL="testutils/hello_world.wsdl"
serviceClass="org.apache.hello_world_soap_http.Greeter"
endpointName="s:SoapPort"
serviceName="s:SOAPService"
xmlns:s="http://apache.org/hello_world_soap_http" />
您能否尝试一个简单的telnet测试,如:telnet localhost 8080,并查看该端口上是否有侦听器?另外,0.0.0.0应该监听所有接口。有时我发现我不得不使用实际的机器IP地址,而不是环回地址。您也可以尝试一下吗?您可以尝试一个简单的telnet测试,比如:telnet localhost 8080,并查看该端口上是否有侦听器吗?另外,0.0.0.0应该监听所有接口。有时我发现我不得不使用实际的机器IP地址,而不是环回地址。你也能试试吗?