---
title: DbConnectionServiceProxy
summary: API reference for Legacy.DbConnectionServiceProxy.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.Web.Proxies
reference_type: package
---

# DbConnectionServiceProxy

`Legacy.DbConnectionServiceProxy` hides the internal generated `ConnectInfoSoapClient` behind two connection-string resolution methods, delegating Oracle and SQL Server connection-string construction entirely to the remote legacy connect-info service and returning strings that contain database credentials. It is constructed by `Services/SAIF.Services.Common/DbConnectionService.cs`. The source file name (`DbConnectionsServiceProxy.cs`) has an extra "s" relative to the class name*.

## Purpose
- Resolve an Oracle connection string, tagging the request with the process OS user and decoding the `ZSPECIALCHAR` token in the response ([OP-WP-07](../../operations/resolve-a-database-connection-string.md), [WP-BR-012](../../business-rules.md#wp-br-012-connection-string-requests-carry-the-process-user-and-pool-code), [WP-BR-013](../../business-rules.md#wp-br-013-oracle-connection-strings-decode-the-zspecialchar-token)).
- Resolve a SQL Server connection string with the same request shape, plus an explicit server name.

## Context
- Namespace: `SAIF.Services.Web.Proxies.Legacy`
- Assembly/package: `SAIF.Services.Web.Proxies` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Constructor | `DbConnectionServiceProxy(string serviceUrl)` | Guards `serviceUrl`, then builds a default `BasicHttpBinding` client with no explicit transport security ([WP-BR-001](../../business-rules.md#wp-br-001-required-arguments-must-be-non-null-or-non-empty)) |
| `GetOracleConnectionString` | `string GetOracleConnectionString(string instance, string userName)` | Builds a `ConnectRequestInfo` (`Code = userName`, `Database = instance`, `OSUserid = Environment.UserName`), calls wire `GetODPConnectString`, and decodes the `ZSPECIALCHAR` token to `(char)7` in the result ([WP-BR-012](../../business-rules.md#wp-br-012-connection-string-requests-carry-the-process-user-and-pool-code), [WP-BR-013](../../business-rules.md#wp-br-013-oracle-connection-strings-decode-the-zspecialchar-token)) |
| `GetSqlServerConnectionString` | `string GetSqlServerConnectionString(string server, string instance, string userName)` | Builds the same request plus `Server = server`, calls wire `GetSQLConnectString`, and returns the result unchanged |
| `Dispose` | `void Dispose()` | Closes the underlying generated `ConnectInfoSoapClient` by calling `Close()`, without an `Abort()` fallback on a faulted channel* |

## Behavioral notes
- `userName` is a SAIF pool code passed as `Code`, not an Oracle schema or SQL login; the actual database user/schema is resolved server-side.
- The returned connection string contains credentials; this library does not log or cache it.

## Constraints and usage notes
- The generated client uses a default, unsecured `BasicHttpBinding`; whether the transport is HTTPS depends only on the URL scheme the caller supplies, which matters because the response carries credentials — see [Architecture](../../architecture.md#design-constraints).

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

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