Reputation: 23
I am using Camel CXF endpoint to connect to my soap server. I wanted to add timeout for my request from client. I am using continuationTimeout option for that. But it's not working. The request is timeout without waiting for the time that I've configured.
Below is my endpoint configuration.
<camel-cxf:cxfEndpoint id="tmAPIWSEndpoint" address="http://IN2NPDCEDB01:8088/webservices/services/TransportationManager"
wsdlURL="/wsdl/TransportationManager.wsdl"
endpointName="cis:TransportationManagerPort"
serviceName="cis:TransportationManagerService"
xmlns:cis="http://www.i2.com/cis"
continuationTimeout="60000">
<camel-cxf:properties>
<entry key="dataFormat" value="MESSAGE"/>
<entry key="username" value="XXX"/>
<entry key="password" value="XXX"/>
</camel-cxf:properties>
</camel-cxf:cxfEndpoint>
Upvotes: 2
Views: 8926
Reputation: 12211
Your question is not very clear since there is no camel route so I cant see if you are creating a SOAP service inside Camel or you are calling a SOAP service from Camel as the client. Based on the little bit information you sent it seems you are creating a client.
According to the camel CXF documentation
Notice that this is related to CXF server settings not client settings. You are using this property but I dont think this is what you are looking for.
If you reference the Apache CXF Client Settings Documentation page you will find the following notes there:
If you visit the CXF documentation page there is a lot examples there.
Upvotes: 4
Reputation: 387
Here is how to do it programmatically:
HelloWorld hello = (HelloWorld) context.getBean("helloService");
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(hello);
HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(5000);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setReceiveTimeout(5000);
httpConduit.setClient(httpClientPolicy);
System.out.println(hello.getHelloWorldAsString("Everyone"));
(I am using spirng)
<bean id="helloService"
class="soap.timeout.demo.client.jaxws.HelloWorld"
factory-bean="helloServiceFactory" factory-method="create"/>
<bean id="helloServiceFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="soap.timeout.demo.client.jaxws.HelloWorld"/>
<property name="address" value="http://localhost:9999/ws/hello"/>
</bean>
Upvotes: 1