SAS 9.1.3 Integration Technologies » Developer's Guide


SAS BI Web Services

Discover Method

The Discover method retrieves information, such as stored process metadata or a list of available data sources, from the SAS Metadata Repository. The Discover method returns a list of all the stored processes that have the keyword "XMLA Web Service" on the SAS Metadata Server. The SAS Stored Process Server is not invoked to service the Discover call.

The syntax for the Discover method follows:

   Discover (
      [in] RequestType As EnumString,
      [in] Restrictions As Restrictions,
      [in] Properties As Properties,
      [out] Result As Rowset)

RequestType

RequestType is a required parameter for the Discover method. The value of RequestType is an enumeration value that corresponds to a return rowset. The RequestType parameter specifies the type of information to be returned by the Discover request.

There are two main request types that are normally used with SAS BI Web Services: DISCOVER_DATASOURCES and STOREDPROCESS_PARAMETERS. DISCOVER_DATASOURCES and STOREDPROCESS_PARAMETERS both return a list of the stored processes that can be invoked. DISCOVER_DATASOURCES is a standard XMLA request type that returns a list of available data sources for the server or Web service so that you can select a data source with which to connect. The information returned by the DISCOVER_DATASOURCES request type includes the name and a description of the data source, a URL to connect to the data source, the name and data type of the provider, and the type of security mode that the data source uses, as well as any additional information that is needed to connect to the data source. STOREDPROCESS_PARAMETERS is a request type specific to SAS, and this request type returns a list of all the available stored processes along with a list of the parameters that are specified in each stored process.

Other request types that might be useful with SAS BI Web Services are DISCOVER_PROPERTIES and DISCOVER_SCHEMA_ROWSETS. DISCOVER_SCHEMA_ROWSETS returns a list of all the available request types along with their enumeration values and other information. See the Properties section for more information about what the DISCOVER_PROPERTIES request type returns.

Note: Although the SAS XMLA Stored Process provider supports the DISCOVER_KEYWORDS, DISCOVER_LITERALS, and DISCOVER_ENUMERATORS request types, these request types are not useful for calling stored processes.

DISCOVER_DATASOURCES

The SAS BI Web Service returns one data source for each stored process that has been defined in the metadata for use with Web services.

For each returned stored process, the returned rowset contains:

DataSourceName
specifies the name of the stored process, as specified in BI Manager. For example,
   /Samples/Stored Processes/
      Sample: MEANS Procedure Web Service
DataSourceDescription
specifies the description of the stored process, as specified in BI Manager. For example,
   (PROC MEANS Stored Process that can be invoked by
      the SAS BI Web Services for Java/.Net mid-tier.)
URL
specifies the URL to invoke the XMLA methods. This is usually the same as the URL that is used to invoke this Discover method. For example,
   http://yourserver/xmla/SASSPSProvider/sasxmla.asmx
DataSourceInfo
specifies which data source to use. The SAS Stored Process Server data source is "Provider=SASSPS;".
ProviderName
specifies the provider behind the data source. For the SAS Stored Process Server, this is the "SAS XML for Analysis Stored Process Provider".
ProviderType
specifies the type of provider that is behind the data source. The Stored Process Service only supports "TDP" (Tabular Data Provider).
AuthenticationMode
specifies the authentication required for the given data source (that is, indicates whether a user name and password are required). SAS BI Web Services for .NET only return "Authenticated" if a user name and password are required. SAS BI Web Services for Java always return "Authenticated," meaning that you are required to authenticate to the SAS Metadata Repository whether you pass in credentials or only use default credentials that are configured by the administrator.

STOREDPROCESS_PARAMETERS

STOREDPROCESS_PARAMETERS is a custom request type that is only used by the SAS Stored Process Service provider. It returns metadata describing the parameters that are necessary to call the stored process. A stream parameter is always a required parameter and it never has a default. This does not mean that you are required to have a stream parameter for each stored process, but it means that any stream parameters defined for the stored process must be provided when the stored process is called using the Execute method.

For each returned stored process, the returned rowset contains:

StoredProcessName
specifies the name of the stored process.
Parameters
specifies a container that includes all of the parameters for the stored process.
Parameter
specifies a container that includes all of the details for a stored process parameter.
Name
specifies the name of the stored process parameter.
Description
specifies the description of the stored process parameter.
Type
specifies the parameter type. The possible parameter types are specified in BI Manager. Note that all parameters are passed to SAS as macro variables, so the SAS program does not know the parameter type specified in the metadata.
Required
specifies whether the stored process parameter is required.
Default
specifies a default value for the stored process parameter.
Streams
specifies a container that includes all of the input streams for the stored process.
Stream
specifies a container that includes all of the details for a stored process input stream.

The following is an example of the response for a stored process that takes a single string and a single stream as input:

   <row xmlns="urn:schemas-sas-com:xml-analysis:rowset">
      <StoredProcessName>
         /BIP Tree/copyintoout</StoredProcessName>
      <Parameters>
         <Parameter>
            <Name>inputname</Name>
            <Description>A simple string that we are
               passing as a parameter.</Description>
            <Required>true</Required>
            <Default />
            <Type>String</Type>
         </Parameter>
      </Parameters>
      <Streams>
         <Stream>
            <Name>DataName</Name>
            <Description>This stream does allow
               multi-pass reads, so you do not have to
               use an XMLMap.</Description>
         </Stream>
      </Streams>
   </row>

Restrictions

You can use the Restrictions parameter to filter which results get returned from a call to the Discover method. The restriction name specifies a column in a rowset that you desire to restrict. The restriction value specifies which data to restrict in the column. Use the DISCOVER_SCHEMA_ROWSETS request type to get restriction information about the rowsets that are available in each request type. The DISCOVER_SCHEMA_ROWSETS request type returns a list of all the request types supported by the provider, along with restriction information and descriptions for each request type.

The Restrictions parameter is required in the Discover method, but it can be empty. Invalid values for restrictions are ignored.

The following RestrictionList element restricts a call to Discover STOREDPROCESS_PARAMETERS based on the name of the stored process:

   <RestrictionList
      xmlns="urn:schemas-microsoft-com:xml-analysis">
      <StoredProcessName>
         /Samples/Stored Processes/
            Sample: MEANS Procedure Web Service
      </StoredProcessName>
   </RestrictionList>

Properties

The Properties parameter enables you to specify properties of the Discover method, such as the return format of the result set or the timeout value.

Use the DISCOVER_PROPERTIES request type 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.

The following table contains a list of properties and property information, including sample values, that the DISCOVER_PROPERTIES request type returns. The value of PropertyType for each of these properties is string.

PropertyName PropertyDescription PropertyAccessType Value
Content specifies the content of the XML result: None, Schema, Data, or Both. ReadWrite SchemaData
StateSupport specifies the support for state maintenance offered by the provider: None or Sessions. Read Sessions
UserName specifies the user name to use for database authentication. ReadWrite  
Password specifies the password to use for database authentication. Write  
Domain specifies the domain to use for database authentication. ReadWrite  
ProviderName specifies the name of the XML for Analysis provider. Read SAS XML for Analysis StoredProcess Provider
ProviderVersion specifies the version of the XML for Analysis provider. Read 1.0
Format specifies the format of the XML result: Tabular or Multidimensional. Read Tabular
DataSourceInfo specifies the identifying information that is required to retrieve data from a data source. ReadWrite Provider=SASSPS
Timeout specifies the number of seconds until a request fails due to a timeout. Read  

You can list properties in any order. The Properties parameter is required in the Discover method. The only call to the Discover method that can have empty properties is DISCOVER_DATASOURCES. All other request types require at least DataSourceInfo to be specified, such as:

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

To cause a call to Discover to execute 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 RequestType, Restrictions, and Properties parameters.