SAS 9.1.3 Integration Technologies » Developer's Guide


SAS BI Web Services

Using Web Services

Before you can use Web services, you need to follow these steps on the server side:

  1. Decide whether you want to use SAS BI Web Services for .NET or SAS BI Web Services for Java. Install SAS BI Web Services and the SAS Metadata Server.
  2. Write a SAS program to use as a stored process with Web services.
  3. Define a stored process server.
  4. Define a stored process using BI Manager. Use XMLA Web Service as a keyword when defining a stored process to be called by a SAS BI Web Service. Also, when defining a stored process to be called by a SAS BI Web Service, specify Streaming as the stored process output type.

    Note: BI Manager is available beginning with SAS Foundation Services 1.2. If you have not upgraded to this release, then you can use Stored Process Manager to register and manage stored processes. BI Manager replaces Stored Process Manager. For more information about using BI Manager or Stored Process Manager, see the Help in SAS Management Console.

On the client side, follow these steps to use Web services:

  1. Locate the WSDL.
  2. Write the code for the client application that uses either the Discover method or Execute method to call the Web service.
  3. Run the code.

The SAS code that implements the Web service, the metadata, and the client code that calls the Web service must all be synchronized. The following table shows how to synchronize these three items:

SAS Program Metadata Client Code
Name The name of the file containing the SAS code. Matches the name of the SAS Stored Process with the name of the file.
<StoredProcess name=
   'MyStoredProcess'>
Input Data Reads XML from the fileref.
libname instream
   xml;
The name of the fileref, which must match the name of the input stream.
<Stream name='instream'>
<XMLDataFromClientHere...
</Stream>
Input Parameters Macros.
&tablename
The parameter name is specified in the metadata. Parameters are treated as strings regardless of the type specified in the metadata.
<Parameter
   name='tablename'>
   myParam</Parameter>
Output Data Writes output to the _WEBOUT fileref as XML.
libname _WEBOUT
   xml xmlmeta=
   &_XMLSCHEMA;
Designates the output as 'Streaming'. Uses the returned XML.