SOAP Procedure

Example 6: Changing the Default Timeout for Web Service Calls

Details

This example uses the CONFIGFILE option to set the amount of time, in milliseconds, to wait for a SAS registered Web service response. In this example, the soTimeout value is 20000 milliseconds. You can create a config file with the following contents and change the value to set a different timeout. The following example uses the soap-client-config.xml file that is located in the C:Public directory.

Program

   /* This section of code is not part of the example. The code  */ 
   /* is the content of the file that is pointed to by the CONFIGFILE  */
   /* option in the PROC SOAP command. The soTimeout property that is  */
   /* defined in this file is what changes the timeout.                */   

<?xml version="1.0" encoding="UTF-8" ?>
-<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:aop="http://www.springframework.org/schema/aop"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
-<bean id="httpClientParams" 
       class="org.apache.commons.httpclient.params.HttpClientParams">
       <property name="soTimeout" value="20000" />
  </bean>
</beans>


   /* This is the beginning of the example. */

filename request "c:\temp\AddInts_request.xml" ;
filename response "c:\temp\AddInts_response.xml" ;

data _null_;
   file request;
   input;
   put _infile_;
   datalines4;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:add="http://tempuri.org/AddInts">
   <soapenv:Header/>
   <soapenv:Body>
      <add:addInts>
         <add:parameters>
            <add:int1>2</add:int1>
            <add:int2>3</add:int2>
         </add:parameters>
      </add:addInts> 
   </soapenv:Body>
</soapenv:Envelope>
;;;;

proc soap;
   in=request;
   out=response;
   url="http://somehost.abc.xyz.com:8080/SASBIWS/services/AddInts"
   soapaction="http://tempuri.org/AddInts/addInts"
   configfile="c:\public\soap-client-config.xml";
run;