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¶
- Construct
Legacy.DbConnectionServiceProxy(serviceUrl): guardserviceUrl(WP-BR-001), then build a defaultBasicHttpBindingclient with no explicit transport security. GetOracleConnectionString(instance, userName):- Build a
ConnectRequestInfowithCode = userName(a SAIF pool code, not an Oracle schema),Database = instance, andOSUserid = Environment.UserName, the process identity (WP-BR-012). - Call wire
GetODPConnectString(request). - Replace the token
"ZSPECIALCHAR"with(char)7(BEL) in the returned string (WP-BR-013). - Return the decoded string.
GetSqlServerConnectionString(server, instance, userName): build the sameConnectRequestInfoplusServer = server, call wireGetSQLConnectString(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
serviceUrlat construction throws an argument exception before any wire client is created. - The default
BasicHttpBindinghas 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.
Related documentation¶
Sources¶
Services/SAIF.Services.Web.Proxies/Legacy/DbConnectionsServiceProxy.cs