Skip to content

Resolve SQL Server connection

This operation populates the ConnectionString of a caller-supplied SqlConnection by calling the remote ConnectInfo SOAP service. Unlike the Oracle overload, it has no local-override path: every invocation depends on a live response from the web service.

Field Value
Operation ID OP-CONN-002
Trigger Caller request to populate a SqlConnection
Inputs inServer, inCode, inDatabase, inCnObj
Outputs inCnObj.ConnectionString populated with the resolved SQL Server connection string
Primary components clsConnection.getConnection, ConnectInfo.ConnectInfo.GetSQLConnectString
Entry point SAIF.Framework.Connection\clsConnection.vb

Steps

  1. Instantiate a ConnectInfo.ConnectInfo SOAP proxy and a blank ConnectInfo.ConnectRequestInfo request object.
  2. The generated proxy constructor reads the service endpoint URL from the SAIF_Framework_Connection_ConnectInfo_ConnectInfo setting, the same setting used by the Oracle overload's remote-resolution path.
  3. Populate the outbound request payload for the SOAP call.
  4. Set Composite.Code = inCode.
  5. Set Composite.Database = inDatabase.
  6. Set Composite.Server = inServer.
  7. Set Composite.OSUserid = System.Environment.UserName, providing an audit identity to the remote service rather than performing any local authorization check.
  8. Ensure a target connection object exists before assignment.
  9. If inCnObj is Nothing, create a new System.Data.SqlClient.SqlConnection and use it as the resolution target.
  10. Resolve the SQL Server connection string and apply it directly, with no post-processing.
  11. Call Client.GetSQLConnectString(Composite) (BR-004).
  12. Assign the returned value directly to inCnObj.ConnectionString; unlike the Oracle overload, no token substitution or clause stripping is performed here.
  13. On failure: exceptions raised during proxy construction, the SOAP call, or the final property assignment propagate to the caller unchanged; this method has no local Try/Catch handling.
  14. Return control to the caller.
  15. clsConnection does not open, test, or dispose the SqlConnection; the caller owns that lifecycle from this point forward.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Caller invokes SQL Server getConnection]) --> Init[Instantiate ConnectInfo proxy and request object]
    Init --> Prepare[Populate Composite fields]
    Prepare --> Ensure[Ensure SqlConnection instance exists]
    Ensure --> Resolve[Call GetSQLConnectString]
    Resolve --> Assign[Assign ConnectionString]
    Assign --> EndOk([Return populated SqlConnection])

Failure and edge-case behavior

  • This overload always depends on the ConnectInfo SOAP service; there is no local override branch comparable to the Oracle overload's credential-based bypass, so a caller cannot avoid the remote dependency for SQL Server connections.
  • The method performs a single synchronous remote lookup per call and provides no retry, timeout, or fallback logic.
  • Any failure in proxy construction, the SOAP invocation, or the connection-string assignment exits the method without local recovery logic, surfacing directly to the caller.

Sources

  • SAIF.Framework.Connection\clsConnection.vb
  • SAIF.Framework.Connection\Web References\ConnectInfo\Reference.vb
  • SAIF.Framework.Connection\My Project\Settings.Designer.vb
  • SAIF.Framework.Connection\app.config