DoRequest

Short Description

Executes XML-formatted method calls.

Category

Messaging method

Syntax

rc=DoRequest(inMetadata,outMetadata);

Parameters

Method Parameters
Parameter
Type
Direction
Description
rc
N
out
Return code for the method. For more information, see Return Code.
inMetadata
C
in
XML string that contains a method to execute and the parameters for the method.
outMetadata
C
out
Returned metadata property string that includes the results of the method.

Details

The DoRequest method enables you to submit IOMI methods and their parameters to the SAS Metadata Server in an input XML string. The XML string has the following form:
<MethodName>
   <Parameter1>Value</Parameter1>
   <Parameter2>Value</Parameter2>
   <Parametern>Value</Parametern>
</MethodName>
where <METHODNAME> is an XML element that contains the name of an IOMI method. <PARAMETER 1–n> are XML elements that contain the names of the method's parameters.
Multiple methods can be submitted in one DoRequest request by placing them within a <MULTIPLE_REQUESTS> element and stacking the XML method strings. For example:
<Multiple_Requests>
<MethodName1>
   <Parameter1>Value</Parameter1>
   <Parameter2>Value</Parameter2>
  
<Parametern>Value</Parametern>
</MethodName1>
<MethodName2>
   <Parameter1>Value</Parameter1>
   <Parameter2>Value</Parameter2>
  
<Parametern>Value</Parametern>
</MethodName2>
</Multiple_Requests>
The published method parameter names must be used for all method parameters except INMETADATA. A <METADATA> element must be used to represent the INMETADATA parameter within method calls that support this parameter. For other parameters, the method returns an error if parameter names other than the published names are used. For more information about the format of this method string, see the documentation for the method that you want to execute.
You submit the XML-formatted method calls to the SAS Metadata Server in the DoRequest method's INMETADATA parameter. The XML-formatted method calls are submitted to the server as a string literal (a quoted string). To ensure that the string is parsed correctly, it is recommended that any additional double quotation marks, such as those enclosing XML attribute values in the metadata property string, be marked to indicate that they should be treated as characters. Here are examples of using escape characters in different programming environments to mark the additional double quotation marks:
Java
"<PhysicalTable Name=\"TestTable\" Desc=\"Sample table\"/>"
Visual Basic
"<PhysicalTable Name=""TestTable"" Desc=""Sample table""/>"
Visual C++
"<PhysicalTable Name=\"TestTable\" Desc=\"Sample table\"/>"
SAS
"<PhysicalTable Name=""TestTable"" Desc=""Sample table""/>" "<PhysicalTable Name='TestTable' Desc='Sample table'/>" '<PhysicalTable Name="TestTable" Desc="Sample table"/>'
Any metadata-related (IOMI server interface) method can be submitted to the SAS Metadata Server using the DoRequest method. For information about the exact format of a method request, see the documentation for the method that you want to execute.
The DoRequest method supports requests to metadata objects in both the SAS namespace and the REPOS namespace. Requests that call the SAS and REPOS namespaces can be submitted within the same <MULTIPLE_REQUESTS> element.
The DoRequest method is ACID-compliant. ACID (Atomicity, Consistency, Isolation, Durability) is a term that refers to the guarantee that all of the tasks of a transaction are performed or none of them are. In other words, if multiple methods are submitted, and one method in a DoRequest fails, then all of the methods specified in the XML input string fail.
The DoRequest method's OUTMETADATA string mirrors the INMETADATA string, except requested values are provided.
Check the return code of a DoRequest method call. A nonzero return code indicates that a failure occurred while trying to write metadata. A nonzero return code means none of the changes in any of the methods in the DoRequest were made.

Example

The DoRequest method is issued in the standard interface. The following is an example of how to issue a DoRequest method call regardless of the programming environment.
outMetadata=" ";
inMetadata="XML-method-string";

rc=DoRequest(inMetadata,outMetadata);