---
title: Resolve a database connection string
summary: Resolve an Oracle or SQL Server connection string from the legacy connect-info SOAP service.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.Web.Proxies
reference_type: package
operation_id: OP-WP-07
trigger: Services/SAIF.Services.Common/DbConnectionService.cs (non-eligible), or package consumers
---

# 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](../business-rules.md#wp-br-001-required-arguments-must-be-non-null-or-non-empty)), then build a default `BasicHttpBinding` client with no explicit transport security.
2. **`GetOracleConnectionString(instance, userName)`:**
   1. 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](../business-rules.md#wp-br-012-connection-string-requests-carry-the-process-user-and-pool-code)).
   2. Call wire `GetODPConnectString(request)`.
   3. Replace the token `"ZSPECIALCHAR"` with `(char)7` (BEL) in the returned string ([WP-BR-013](../business-rules.md#wp-br-013-oracle-connection-strings-decode-the-zspecialchar-token)).
   4. Return the decoded string.
3. **`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.

```mermaid
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.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `Services/SAIF.Services.Web.Proxies/Legacy/DbConnectionsServiceProxy.cs`
