I am calling a soap service using camel cxf:cxfEndpoint but getting this BindingOperationInfo error. The configuration looks correct to me but not sure where I am doing wrong.
Endpoint configuration:
<!-- 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>
My Java DSL Router configuration.
from("direct:invokeMyUpdate")
.bean("myAcctSvcClient", "buildSoapReq")
.setHeader(CxfConstants.OPERATION_NAME, constant("getAccountInfo"))
.to("cxf:bean:accountEndpoint")
WSDL elements:
<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>
Below is the error :
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]
Did you try to set also:
<setHeader headerName="operationNamespace">
<constant>http://acct.poc.cog.com/</constant>
</setHeader>
In JAVA DSL I guess:
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")
The second tip from me is to run debugger and put breakpoint on line CxfProducer.java:379
. Than check the value of CxfProducer.client.conduitSelector.endpoint.binding.bindingInfo.operations
.
I am trying to solve the similar problem, where operations set loaded from wsdl are blank.
EDIT: I have found source of my problem, why the created endpoint was of type org.apache.cxf.endpoint.EndpointImpl
instead of org.apache.cxf.jaxws.support.JaxWsEndpointImpl
and had no operations info. CxfEndpoint example:
<cxf:cxfEndpoint
id="id"
...
serviceClass="service.class.name"
>
I declared service.class.name
as webservice client class by mistake, not as webservice interface class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With