Skip to content

Resolve a database connection string

Legacy.DbConnectionServiceProxy wraps the DbConnection SOAP service (ConnectInfoSoapClient) to resolve Oracle or SQL Server connection strings — including credentials — remotely, without this library executing any SQL of its own.

Field Value
Operation ID OP-WP-07
Trigger Services/SAIF.Services.Common/DbConnectionService.cs (non-eligible in this run), or package consumers
Inputs instance, userName, optionally server
Outputs A connection string containing credentials
Primary components Legacy.DbConnectionServiceProxy.GetOracleConnectionString, GetSqlServerConnectionString
Entry point Services/SAIF.Services.Web.Proxies/Legacy/DbConnectionsServiceProxy.cs

Steps

  1. Construct Legacy.DbConnectionServiceProxy(serviceUrl): guard serviceUrl (WP-BR-001), then build a default BasicHttpBinding client with no explicit transport security.
  2. GetOracleConnectionString(instance, userName):
  3. Build a ConnectRequestInfo with Code = userName (a SAIF pool code, not an Oracle schema), Database = instance, and OSUserid = Environment.UserName, the process identity (WP-BR-012).
  4. Call wire GetODPConnectString(request).
  5. Replace the token "ZSPECIALCHAR" with (char)7 (BEL) in the returned string (WP-BR-013).
  6. Return the decoded string.
  7. GetSqlServerConnectionString(server, instance, userName): build the same ConnectRequestInfo plus Server = server, call wire GetSQLConnectString(request), and return the result unchanged.

Process flow

The following diagram visualizes the two connection-string resolution paths.

flowchart TD
    Start([Caller invokes a connection method]) --> Build["Build ConnectRequestInfo<br>(Code = pool code, OSUserid = process user)"]
    Build --> Which{Oracle or SQL Server?}
    Which -->|Oracle| Odp["Call wire GetODPConnectString"] --> Decode["Replace ZSPECIALCHAR<br>with BEL character"] --> RetO([Return decoded string])
    Which -->|SQL Server| Sql["Call wire GetSQLConnectString"] --> RetS([Return string unchanged])

Failure and edge-case behavior

  • A null/empty serviceUrl at construction throws an argument exception before any wire client is created.
  • The default BasicHttpBinding has no explicit transport security; whether the call is HTTPS depends only on the URL scheme the caller supplies, and the returned string contains database credentials — this library does not log or cache the returned string.

Sources

  • Services/SAIF.Services.Web.Proxies/Legacy/DbConnectionsServiceProxy.cs