Previous Page | Next Page

Writing SAS BI Web Services Using XMLA

Execute Method


Overview of the 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 Web service performs the following actions:

Here is the syntax for the Execute method:

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 the Execute method, the SAS code has a macro defined whose name corresponds to the String parameter:

%LET InputName=myData

The SAS code also has 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 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 SAS 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 your own value for the DataSourceInfo property. Use a value only from the DISCOVER_DATASOURCES rowset.  [cautionend]

To cause the execute method 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 the SAS Intelligence Platform: Web Application Administration Guide.


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.

Previous Page | Next Page | Top of Page