我正在尝试将 Apache CXF 与 Apache Camel 集成。 Camel 的配置:
<cxf:cxfEndpoint id="authTest"
address="/cxfAuth"
serviceClass="com.test.AuthService" >
<cxf:properties>
<entry key="dataFormat" value="POJO" />
<entry key="setDefaultBus" value="true" />
</cxf:properties>
</cxf:cxfEndpoint>
<camel:camelContext trace="true">
<camel:route>
<camel:from uri="cxf:bean:authTest" />
<camel:to uri="bean:routeExitResponseProcessor"/>
</camel:route>
</camel:camelContext>
现在要调用 Web 服务上的特定操作,我使用的是:
<camel:route>
<camel:from uri="direct:startAuthTest"/>
<camel:setHeader headerName="getEmployee">
<camel:constant>gid</camel:constant>
</camel:setHeader>
<camel:to uri="cxf:bean:authTest" />
<camel:log message=">>> data is : ${body}"/>
<camel:to uri="bean:routeExitResponseProcessor"/>
</camel:route>
但是在包含上述配置后,我在服务器控制台上收到 WARN ServletController:149 - Can't find the request for http://localhost:8080/CXFService/services/cxfAuth's Observer
在浏览器上找不到我的网络服务。
请帮忙。
最佳答案
您可以调用以下命令来获取正在调用的 CXF 操作名称...参见 http://camel.apache.org/cxf.html了解更多详情
String operation = (String)in.getHeader(CxfConstants.OPERATION_NAME);
另外,请参阅此单元测试以了解示例用法...
关于web-services - 通过 Apache Camel 调用 CXF webservice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10301895/