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¶
- Instantiate a
ConnectInfo.ConnectInfoSOAP proxy and a blankConnectInfo.ConnectRequestInforequest object. - The generated proxy constructor reads the service endpoint URL from the
SAIF_Framework_Connection_ConnectInfo_ConnectInfosetting, the same setting used by the Oracle overload's remote-resolution path. - Populate the outbound request payload for the SOAP call.
- Set
Composite.Code = inCode. - Set
Composite.Database = inDatabase. - Set
Composite.Server = inServer. - Set
Composite.OSUserid = System.Environment.UserName, providing an audit identity to the remote service rather than performing any local authorization check. - Ensure a target connection object exists before assignment.
- If
inCnObjisNothing, create a newSystem.Data.SqlClient.SqlConnectionand use it as the resolution target. - Resolve the SQL Server connection string and apply it directly, with no post-processing.
- Call
Client.GetSQLConnectString(Composite)(BR-004). - Assign the returned value directly to
inCnObj.ConnectionString; unlike the Oracle overload, no token substitution or clause stripping is performed here. - 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/Catchhandling. - Return control to the caller.
clsConnectiondoes not open, test, or dispose theSqlConnection; 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
ConnectInfoSOAP 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.
Related documentation¶
Sources¶
SAIF.Framework.Connection\clsConnection.vbSAIF.Framework.Connection\Web References\ConnectInfo\Reference.vbSAIF.Framework.Connection\My Project\Settings.Designer.vbSAIF.Framework.Connection\app.config