SAS 9.1.3 Integration Technologies » Developer's Guide


SAS BI Web Services

Execute Method

Client applications of the Web service call the Execute method to run a SAS Stored Process.

When an application calls the Execute method, the following actions occur. The Web service does the following:


Syntax

The syntax for the Execute method follows:

   Execute (
      [in] Command As Command,
      [in] Properties As Properties,
      [out] Result As Resultset)

Command

The Execute method takes the Command and Properties parameters as input. Both of these parameters are in XML.

The following code shows the command passed to the Execute method:

      <StoredProcess name="MyStoredProcess">
         <Stream name="DataName"> <myXML>data</myXML> </Stream>
         <Parameter name="InputName">myData</Parameter>
      </StoredProcess>

When the previous code is passed to Execute(), the SAS code will have a macro defined whose name corresponds to the String parameter:

   %LET InputName=ThisIsTheValue

The SAS code will also have a libref assigned that corresponds to the name of the Data parameter:

   libname DataName;

The SAS program should write output to the pre-assigned fileref _WEBOUT. Most applications will do this by using the XML LIBNAME engine, as follows:

   libname _WEBOUT xml xmlmeta=&_XMLSCHEMA;

   data _WEBOUT.a;

Properties

The Properties parameter enables you to specify properties of the Execute method. Properties describe how to invoke the Command parameter. Calling applications specify the SASSPS (Stored Process Service) Provider to be used in DataSourceInfo, as shown in the following example:

      <PropertyList>
         <DataSourceInfo>
            Provider=SASSPS;
         </DataSourceInfo>
      </PropertyList>

Use the DISCOVER_PROPERTIES request type in the Discover method to get information about properties that are available for each request type and the values that are associated with those properties. The DISCOVER_PROPERTIES request type returns information about both standard and provider-specific properties. The returned information includes the name, description, data type, access, and current value of each property. The information also shows whether each property is required.

You can list properties in any order. The Properties parameter is required in the Discover method, but it can be empty. The Properties parameter must be specified for the Execute method, and must include at least the DataSourceInfo property.

Note: After you have selected a data source from the DISCOVER_DATASOURCES rowset, set the DataSourceInfo property in the Properties parameter, which is sent to the server using the Command parameter by the Execute method. Do not attempt to write in your own value for the DataSourceInfo property, only use a value from the DISCOVER_DATASOURCES rowset.

To cause a call to Execute to run under a specific user's identity, a UserName and Password property can be included in the PropertyList element, such as:

   <PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
      <DataSourceInfo>
         Provider=SASSPS
      </DataSourceInfo>
      <UserName>username</UserName>
      <Password>password</Password>
   </PropertyList>

If you choose to include the UserName or Password properties, it is important to ensure that access to your Web service is secure and encrypted. For more information, see Securing SAS BI Web Services.

Result

The Result parameter is required. This parameter specifies the result set that the provider returns. The information that is returned can vary according to which values are used in the Command and Properties parameters.