Camel cxf:cxfEndpoint Producer error : Can't find the BindingOperationInfo with operation name
Camel cxf:cxfEndpoint Producer error : Can't find the BindingOperationInfo with operation name
我正在使用 camel cxf:cxfEndpoint 调用 soap 服务,但收到此 BindingOperationInfo 错误。配置对我来说是正确的,但不确定我哪里做错了。
端点配置:
<!-- Soap Client -->
<cxf:cxfEndpoint id="accountEndpoint" address="http://localhost:3333/wspoc/user"
wsdlURL="/wsdl/userSvc.wsdl"
serviceClass="com.cog.poc.acct.HelloWorldImplService"
endpointName="ws:HelloWorldImplPort"
serviceName="ws:HelloWorldImplService"
xmlns:ws="http://acct.poc.cog.com/" loggingFeatureEnabled="true">
<cxf:properties>
<entry key="dataFormat" value="POJO"/>
</cxf:properties>
</cxf:cxfEndpoint>
我的 Java DSL 路由器配置。
from("direct:invokeMyUpdate")
.bean("myAcctSvcClient", "buildSoapReq")
.setHeader(CxfConstants.OPERATION_NAME, constant("getAccountInfo"))
.to("cxf:bean:accountEndpoint")
WSDL 元素:
<definitions targetNamespace="http://acct.poc.cog.com/"
name="HelloWorldImplService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://acct.poc.cog.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<service name="HelloWorldImplService">
<port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
<soap:address location="http://localhost:3333/wspoc/user" />
</port>
</service>
<binding name="HelloWorldImplPortBinding" type="tns:HelloWorld">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<operation name="getHelloWorldAsString">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</output>
</operation>
<operation name="getAccountInfo">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</output>
</operation>
</binding>
错误如下:
Stacktrace
: java.lang.IllegalArgumentException: Can't find the BindingOperationInfo with operation name {http://acct.poc.cog.com/}getAccountInfo. Please check the message headers of operationName and operationNamespace.
at org.apache.camel.component.cxf.CxfProducer.getBindingOperationInfo(CxfProducer.java:379) [camel-cxf-2.16.0.jar:2.16.0]
at org.apache.camel.component.cxf.CxfProducer.prepareBindingOperation(CxfProducer.java:211) [camel-cxf-2.16.0.jar:2.16.0]
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:110) [camel-cxf-2.16.0.jar:2.16.0]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:141) [camel-core-2.16.0.jar:2.16.0]
您是否也尝试设置:
<setHeader headerName="operationNamespace">
<constant>http://acct.poc.cog.com/</constant>
</setHeader>
在 JAVA DSL 我猜:
from("direct:invokeMyUpdate")
.bean("myAcctSvcClient", "buildSoapReq")
.setHeader(CxfConstants.OPERATION_NAME, constant("getAccountInfo"))
.setHeader(CxfConstants.OPERATION_NAMESPACE, constant("http://acct.poc.cog.com/"))
.to("cxf:bean:accountEndpoint")
我的第二个提示是 运行 调试器并在行 CxfProducer.java:379
上放置断点。比检查 CxfProducer.client.conduitSelector.endpoint.binding.bindingInfo.operations
.
的值
我正在尝试解决类似的问题,其中从 wsdl 加载的操作集是空白的。
编辑:我找到了问题的根源,为什么创建的端点类型为 org.apache.cxf.endpoint.EndpointImpl
而不是 org.apache.cxf.jaxws.support.JaxWsEndpointImpl
并且没有操作信息。 CxfEndpoint 示例:
<cxf:cxfEndpoint
id="id"
...
serviceClass="service.class.name"
>
我错误地将 service.class.name
声明为网络服务客户端 class,而不是网络服务接口 class。
我正在使用 camel cxf:cxfEndpoint 调用 soap 服务,但收到此 BindingOperationInfo 错误。配置对我来说是正确的,但不确定我哪里做错了。
端点配置:
<!-- Soap Client -->
<cxf:cxfEndpoint id="accountEndpoint" address="http://localhost:3333/wspoc/user"
wsdlURL="/wsdl/userSvc.wsdl"
serviceClass="com.cog.poc.acct.HelloWorldImplService"
endpointName="ws:HelloWorldImplPort"
serviceName="ws:HelloWorldImplService"
xmlns:ws="http://acct.poc.cog.com/" loggingFeatureEnabled="true">
<cxf:properties>
<entry key="dataFormat" value="POJO"/>
</cxf:properties>
</cxf:cxfEndpoint>
我的 Java DSL 路由器配置。
from("direct:invokeMyUpdate")
.bean("myAcctSvcClient", "buildSoapReq")
.setHeader(CxfConstants.OPERATION_NAME, constant("getAccountInfo"))
.to("cxf:bean:accountEndpoint")
WSDL 元素:
<definitions targetNamespace="http://acct.poc.cog.com/"
name="HelloWorldImplService" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://acct.poc.cog.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<service name="HelloWorldImplService">
<port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
<soap:address location="http://localhost:3333/wspoc/user" />
</port>
</service>
<binding name="HelloWorldImplPortBinding" type="tns:HelloWorld">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<operation name="getHelloWorldAsString">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</output>
</operation>
<operation name="getAccountInfo">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://acct.poc.cog.com/" />
</output>
</operation>
</binding>
错误如下:
Stacktrace : java.lang.IllegalArgumentException: Can't find the BindingOperationInfo with operation name {http://acct.poc.cog.com/}getAccountInfo. Please check the message headers of operationName and operationNamespace. at org.apache.camel.component.cxf.CxfProducer.getBindingOperationInfo(CxfProducer.java:379) [camel-cxf-2.16.0.jar:2.16.0] at org.apache.camel.component.cxf.CxfProducer.prepareBindingOperation(CxfProducer.java:211) [camel-cxf-2.16.0.jar:2.16.0] at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:110) [camel-cxf-2.16.0.jar:2.16.0] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:141) [camel-core-2.16.0.jar:2.16.0]
您是否也尝试设置:
<setHeader headerName="operationNamespace">
<constant>http://acct.poc.cog.com/</constant>
</setHeader>
在 JAVA DSL 我猜:
from("direct:invokeMyUpdate")
.bean("myAcctSvcClient", "buildSoapReq")
.setHeader(CxfConstants.OPERATION_NAME, constant("getAccountInfo"))
.setHeader(CxfConstants.OPERATION_NAMESPACE, constant("http://acct.poc.cog.com/"))
.to("cxf:bean:accountEndpoint")
我的第二个提示是 运行 调试器并在行 CxfProducer.java:379
上放置断点。比检查 CxfProducer.client.conduitSelector.endpoint.binding.bindingInfo.operations
.
的值
我正在尝试解决类似的问题,其中从 wsdl 加载的操作集是空白的。
编辑:我找到了问题的根源,为什么创建的端点类型为 org.apache.cxf.endpoint.EndpointImpl
而不是 org.apache.cxf.jaxws.support.JaxWsEndpointImpl
并且没有操作信息。 CxfEndpoint 示例:
<cxf:cxfEndpoint
id="id"
...
serviceClass="service.class.name"
>
我错误地将 service.class.name
声明为网络服务客户端 class,而不是网络服务接口 class。