SOAPWIPSERVICE Function

Calls a SAS registered Web service by using WS-Security authentication; credentials are provided in the arguments.

Category: Web Service
Note: This function uses the SAS environments file.

Syntax

SOAPWIPSERVICE (IN, SERVICE <,options>)

Required Arguments

IN

specifies a character value that is the fileref. IN is used to input XML data that contains the SOAP request.

SERVICE

specifies the service name of the endpoint service as the service is stored in the Service Registry.

Optional Arguments

OUT

specifies a character value that is the fileref where the SOAP response output XML will be written.

SOAPACTION

specifies a character value that is a SOAPAction element to invoke on the Web service.

WSSUSERNAME

specifies a character value that is a WS-Security user name.

WSSPASSWORD

specifies a character value that is a WS-Security password, which is the password for WSSUSERNAME. Encodings that are produced by PROC PWENCODE are supported.

ENVFILE

specifies a character value that is the location of the SAS environments file.

ENVIRONMENT

specifies a character value that is the environment defined in the SAS environments file to use.

MUSTUNDERSTAND

specifies a numeric value that is the setting for the mustUnderstand attribute in the SOAP header.

CONFIGFILE

specifies a character value that is a Spring configuration file that is used primarily to set time-out values.

DEBUG

specifies a character value that is the full path to a file that is used for debugging logging output.

Details

The SAS Environments File

The name of the service is provided in the Service Registry. The SAS environments file is used to locate the Service Registry and the destination service, as well as the Security Token Service, which generates a security token with the provided credentials.

Example

The following example shows how to use the SOAPWIPSERVICE function in a DATA step:
FILENAME request 'c:\temp\Request.xml';
FILENAME response 'c:\temp\Response.xml';

data _null;
    service="ReportRepositoryService";
    soapaction="http://www.test.com/xml/schema/test-svcs/reportrepository-9.3/
               DirectoryServiceInterface/isDirectory";
    envfile="http://somemachine.abc.xyz.com/schemas/test-environment.xml";
    environment="test";
    wssusername="user-name";
    wsspassword="password";
    
    rc=soapwipservice("REQUEST", service, "RESPONSE", soapaction, wssusername, 
                       wsspassword, envfile, environment);
run;

 
This section gives you information about the SOAP request:
Request.xml:
<soapenv:Envelope xmlns:rep="http://www.test.com/xml/schema/test-svcs/
                        reportrepository-9.3" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <Action xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://
                     www.test.com/xml/schema/test-svcs/reportrepository-9.3/
                     DirectoryServiceInterface/isDirectory</Action>
   </soapenv:Header>
   <soapenv:Body>
      <rep:isDirectoryDirectoryServiceInterfaceRequest>
         <rep:dirPathUrl>SBIP://Foundation/Users/someuser/My Folder
                                </rep:dirPathUrl>
      </rep:isDirectoryDirectoryServiceInterfaceRequest>
   </soapenv:Body>
</soapenv:Envelope>

test-environments.xml:

<environments xmlns="http://www.test.com/xml/schema/test-environments-9.3
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.test.com/xml/schema/test-environments-9.3
      http://www.test.com/xml/schema/test-environments-9.3/
             test-environments-9.3.xsd">

<environment name="default" default="true">
   <desc>Default Test Environment</desc>
   <service-registry>http://machine1.abc.xyz.com:8080/TESTWIPServices/remote/
                            serviceRegistry
   </service-registry>
</environment>

<environment name="test" default="false">
   <desc>Environment for PROC SOAP testing</desc>
   <service-registry>http://machine2.abc.xyz.com:8080/TESTWIPSoapServices/
                            Service Registry/serviceRegistry
   </service-registry>
</environment>

</environments>