SAS 9.1.3 Integration Technologies » Developer's Guide


Developing Windows Clients
Client Requirements
Client Installation
Security
Selecting a Windows Programming Language
Programming with Visual Basic
Programming in the .NET Environment
Using VBScript
Programming with Visual C++
Using the Object Manager
Creating an Object
Object Manager Interfaces
Using a Metadata Server with the Object Manager
Metadata Configuration Files
Error Reporting
Code Samples
Using Connection Pooling
Choosing Integration Technologies or COM+ Pooling
Using Integration Technologies Pooling
Using Com+ Pooling
Pooling Samples
Using the IOM Data Provider
Using the Workspace Manager
Class Documentation
Windows Clients

SAS Object Manager Error Reporting

If a call succeeds in obtaining an object, the method returns S_OK. However, there are many reasons an error might occur. Sometimes an error might occur even before the connection attempt is made. An example of such an error follows:

  • Requested logical name was not found

Other errors can occur during the connection attempt. Examples include the following:

  • Invalid userid/password
  • Couldn't connect to a SAS server
  • Invalid hostname
  • Server configuration error

Errors can occur even though a successful connection is established. Errors that occur during connection can be reported through the logging mechanism. To enable logging, set the ObjectFactory.LogEnabled property to TRUE. When LogEnabled equals TRUE, both successful and failed connection attempts are recorded in the log. You can obtain error information by calling GetCreationLog as follows:

   ObjectFactory.GetCreationLog(erase,allThreads)

The parameters for GetCreationLog follow:

erase
Indicates whether to erase all of the accumulated logging information. Values are TRUE or FALSE.
allThreads
Indicates the threads for which to obtain connectionAttempts log information. The values for the allThreads parameter are
FALSE
Obtain log information for your current thread.
TRUE
Obtain log information for all threads in the process.

Error XML

The error information returned through XML allows applications to fix detected problems. Applications can be used to fix these errors by parsing the XML and possibly providing a user interface or sending a message to an administrator to have the errors fixed.

The following example is an output from GetCreationLog. The first attempt establishes an IOM Bridge connection to the SAS Metadata Server, and the second attempt establishes a COM connection to a workspace server. Note that the sasport and sasmachinednsname are not reported for COM connections.

   <connectionAttempts>
      <connectionAttempt>
         <description>Connected.</description>
         <status>0x0</status>
         <saslogin>myDomain\myLogin</saslogin>
         <sasmachinednsname>myMachine</sasmachinednsname>
         <sasport>1235</sasport>
         <sasclassid>2887E7D7-4780-11D4-879F-00C04F38F0DB</sasclassid>
         <sasprogid>SASOMI.OMI.1</sasprogid>
         <sasserver>SAS Metadata Server</sasserver>
         <threadid>3324</threadid>
         <name>OMR</name>
      </connectionAttempt>
      <connectionAttempt>
         <description>Connected.</description>
         <status>0x0</status>
         <saslogin></saslogin>
         <sasmachinednsname>myOtherMachine</sasmachinednsname>
         <sasclassid>440196D4-90F0-11D0-9F41-00A024BB830C</sasclassid>
         <sasprogid>SAS.Workspace.1</sasprogid>
         <sasserver>myOtherMachineCOM - Workspace Server</sasserver>
         <threadid>3324</threadid>
      </connectionAttempt>
   </connectionAttempts>

The following error message shows a failed IOM Bridge connection attempt. Note that the port number, machine name, and login are listed for IOM Bridge connections.

   <connectionAttempts>
      <connectionAttempt>
         <description>Could not establish a connection to the SAS server on
            the requested machine. Verify that the SAS server has been
            started with the -objectserver option or that the SAS
            spawner has been started. Verify that the port Combridge is
            attempting to connect to is the same as the port SAS (or the
            spawner) is listening on.</description>
         <status>0x8004274d</status>
         <saslogin>Username</saslogin>
         <sasmachinednsname>machineName</sasmachinednsname>
         <sasport>1234</sasport>
         <sasclassid>440196D4-90F0-11D0-9F41-00A024BB830C</sasclassid>
         <sasprogid>SAS.Workspace.1</sasprogid>
         <sasserver>myWorkspace - Workspace Server</sasserver>
         <threadid>3324</threadid>
      </connectionAttempt>
   </connectionAttempts>