Aaron Greenlee
Aaron Greenlee

Reputation: 4577

ColdFusion Web-service Timeout

I have to call a third-party Web service that frequently does not respond. I tried to timeout my requests, however, the timeout does not appear to make any difference. Can you share what I may be doing wrong?

Sample Code

ws = createObject("webservice", "http://domain.com/webservice?wsdl",{timeout=25});

Thread Stack Trace

This is where the request waiting for the Web-service will hang waiting for a response. The thread can not be killed with Fusion Reactor.

java.net.SocketInputStream.socketRead0(SocketInputStream.java:???)[Native Method]
java.net.SocketInputStream.read(SocketInputStream.java:129)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read(BufferedInputStream.java:237)
org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:581)
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:142)
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
org.apache.axis.client.Call.invokeEngine(Call.java:2765)
org.apache.axis.client.Call.invoke(Call.java:2748)
org.apache.axis.client.Call.invoke(Call.java:2424)
org.apache.axis.client.Call.invoke(Call.java:2347)
org.apache.axis.client.Call.invoke(Call.java:1804)
membership.MembershipappfacadeCfcSoapBindingStub.getUserData(MembershipappfacadeCfcSoapBindingStub.java:1189)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:???)[Native Method]
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
coldfusion.xml.rpc.ServiceProxy.invokeImpl(ServiceProxy.java:225)
coldfusion.xml.rpc.ServiceProxy.invoke(ServiceProxy.java:145)
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
cfMemberGateway2ecfc1748494758$funcPOPULATEFEUSERFROMCOOKIES.runFunction(C:\inetpub\platform\models\gateway\MemberGateway.cfc:208)

Thanks.

Upvotes: 1

Views: 1276

Answers (1)

Shirak
Shirak

Reputation: 26

Have you tried use cfsetting requesttimeout="25" before webservice call?. Also if you use tag base cfinvoke with timeout property it should work for you.

Upvotes: 1

Related Questions