Results 1 to 2 of 2

Thread: Pls tell me how to handle connection time out error in ws:outbound gateway

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Default Pls tell me how to handle connection time out error in ws:outbound gateway

    <?xml version="1.0" encoding="UTF-8"?>

    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:stream="http://www.springframework.org/schema/integration/stream"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:ws="http://www.springframework.org/schema/integration/ws"
    xmlns:bean="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/integration
    http://www.springframework.org/schem...ntegration.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schem...ng-context.xsd
    http://www.springframework.org/schem...gration/stream
    http://www.springframework.org/schem...ion-stream.xsd
    http://www.springframework.org/schema/integration/ws
    http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd">


    <channel id="input" />
    <channel id="output" />




    <ws:outbound-gateway request-channel="input"
    reply-channel="output" uri="http://150.20.0.140:10000/HCDCMS/services/DCMSService" />




    <outbound-channel-adapter channel="output"
    ref="webServiceController" method="showResult" />




    </beans:beans>

  2. #2

    Default

    If by handling you mean you want to avoid it, then set the soTimeout on the HttpConnectionManager and use that to configure a message-sender for the gateway.

    Code:
      <bean id="httpConnectionManager"
            class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager">
        <property name="params">
          <bean class="org.apache.commons.httpclient.params.HttpConnectionManagerParams"
                p:soTimeout="5000" <!-- 5 seconds -->
                p:maxTotalConnections="100"
                p:defaultMaxConnectionsPerHost="100">
          </bean>
        </property>
      </bean>
    
      <bean id="httpSender"
            class="org.springframework.ws.transport.http.CommonsHttpMessageSender">
        <constructor-arg name="httpClient">
          <bean class="org.apache.commons.httpclient.HttpClient"
                p:httpConnectionManager-ref="httpConnectionManager"/>
        </constructor-arg>
      </bean>
    
        <int-ws:outbound-gateway 
                                 message-sender="httpSender"
                                and the usual stuff />

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •