SAS 9.1.3 Integration Technologies » Developer's Guide


Using the Workspace Manager
Launching IOM Servers
Administering the SAS Workspace Manager
SAS Workspace Manager Interfaces
Error Reporting
Using Workspace Pooling
Code Samples
Windows Clients

Error Reporting

If the call succeeds in obtaining a workspace, the method returns S_OK. However, there are many reasons an error may occur. Sometimes an error can occur even before the connection attempt is made. The following is an example of such an error:

  • 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 when connecting are reported either through the IErrorInfo mechanism (if no SAS workspace is created) or returned in the errorString parameter (if a SAS workspace is created.) The Err.Description (IErrorInfo->Description() in C) and errorString both use the same format which is XML.

If UseXMLInErrorInfo is set to false (it defaults to true), Err.Description will only contain a single error string, that refers to the last connection attempted.

Error XML

The error information returned through XML allows applications to fix the problems detected. Applications interested in fixing these errors will need to parse the XML and possibly provide a UI to the user, or send a message to the administrator to get the errors fixed so they don't occur again. Here is a sample of the error XML that gets generated (and returned in the errorString parameter of either CreateWorkspaceByLogicalName or CreateWorkspaceByServer) when there is a successful connection made, but the first attempt failed:

   <connectionAttempts>
   <connectionAttempt>
      <sasservername>MyServer</sasservername>
      <machineDNSName>MyServer.MyCompany.com</machineDNSName>
      <saslogin>MyUserID</saslogin>
      <status>0x8004274d</status>
      <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>
   </connectionAttempt>
   <connectionAttempt>
      <sasserver>MyServer</sasserver>
      <machineDNSName>MyServer.MyCompany.com</machineDNSName>
      <saslogin>MyUserID</saslogin>
      <status>0x0</status>
      <description>Connected</description>
   </connectionAttempt>
   </connectionAttempts>