1

I am trying to test the connection timeout for my injected client.

I am able to call the client , but the timeout is not working. Its taking default and taking more than 1 mins.My configuration below :-

Spring context :-

<bean id="myServiceClient" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
    <property name="serviceInterface" value="au.com.my.service.employee.namespace.service"/>
    <property name="namespaceUri" value="http://service.my.client.namespace.au/"/>
    <property name="serviceName" value="MyWebService" />
    <property name="endpointAddress" value="http://mywsdl.com?wsdl" />
    <property name="wsdlDocumentUrl" value="http://mywsdl.com?wsdl" />
    <property name="lookupServiceOnStartup" value="false" />
    <property name="portName" value="myServicePort" />
   <property name="customProperties"  ref="jaxwsCustomProperties" />
</bean>

Custom properties:

<util:map id="jaxwsCustomProperties">
    <entry key="com.sun.xml.internal.ws.request.timeout">
        <value type="java.lang.Integer">1000</value>
    </entry>
    <entry key="com.sun.xml.internal.ws.connect.timeout">
        <value type="java.lang.Integer">1000</value>
    </entry>
    <entry key="com.sun.xml.ws.request.timeout">
        <value type="java.lang.Integer">1000</value>
    </entry>
    <entry key="com.sun.xml.ws.connect.timeout">
        <value type="java.lang.Integer">1000</value>
    </entry>
</util:map>

But, While I am calling this service its taking more than 1 mins. As per my understanding it should throw the connection timeout exception after 1 sec.

Please help me and advise if anything missed.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
JDGuide
  • 6,239
  • 12
  • 46
  • 64

1 Answers1

1

If you're expecting a Read timed out exception, try setting the javax.xml.ws.client.receiveTimeout property, that solved our similar issue.

As far as I understand, connect.timeout is used for how long the client is waiting to get a connection before throwing a connection refused error, socket timeout is how long the client is waiting for individual packets, see ConnectionTimeout versus SocketTimeout.

Community
  • 1
  • 1
Mark Pardijs
  • 163
  • 1
  • 9