---
title: Client reference
summary: Complete reference for every contract operation this repository calls.
status: draft
owner: SAIF.Core documentation
last_reviewed: 2026-09-24
---

# Client reference

This page documents every operation `WSLogging` declares. `WriteError` is called from repository source through `clsWSLoggingSoapClient`; `WriteTrace` and `WriteAudit` are declared by the WSDL but have no call site in repository source.

---

## WriteError

Records an exception's application, environment, error date, message, source, page, user, and machine context against the remote logging service.

| Field | Value |
| --- | --- |
| **Operation** | `WriteError` |
| **SOAP action** | `http://tempuri.org/SAIF/Logging/clsWSLogging/WriteError` |
| **Proxy member** | `void WriteError(ErrorInfoStruct inError)` |
| **Input message** | `ErrorInfoStruct` |
| **Output message** | None — one-way |
| **Declared faults** | None declared |
| **Called by** | `LoggingServiceProxy.LogException(ApplicationExceptionDetail detail)` (`Services/SAIF.Services.Web.Proxies/LoggingServiceProxy.cs:23-27`), reached from `EnvironmentApi.SAIFExceptionLogger.Log` (`Services/SAIF.Services.WebApi/EnvironmentApi/App_Start/SAIFExceptionLogger.cs:33`) |
| **Source** | `Services/SAIF.Services.Web.Proxies/LoggingServiceProxy.cs:26` |

### Input message

| Part | Type | Required | Bound from | Purpose |
| --- | --- | --- | --- | --- |
| `ApplicationName` | `string` | Not stated in the WSDL | `detail.Application` = `"EnvironmentApi"` | The logical application name |
| `Environment` | `string` | Not stated in the WSDL | `detail.Environment` = `"NetProd"` (hard-coded) | The deployment track — see [BR-LOG-001](business-rules.md#br-log-001-environment-is-hard-coded-to-netprod) |
| `ErrorDate` | `dateTime` | Yes | `detail.ExceptionDate` = `DateTime.Now` | When the exception was captured |
| `ExceptionInfo` | `string` | Not stated in the WSDL | `detail.Message` = `Exception.GetErrorLogFormattedException()` | The formatted exception message and stack trace |
| `ExceptionSource` | `string` | Not stated in the WSDL | `detail.Source` = `""` | Always empty at this call site |
| `MachineName` | `string` | Not stated in the WSDL | `detail.Machine` = `Environment.MachineName` | The machine that logged the error |
| `PageName` | `string` | Not stated in the WSDL | `detail.Page` = `RequestUri.PageName()` | Derived from the failing request's URI |
| `StateInfo` | `string` | Not stated in the WSDL | `detail.State` = `"Uri = " + RequestUri` | The full request URI |
| `Username` | `string` | Not stated in the WSDL | `detail.User` = `context.RequestContext.Principal.Identity.Name` | The authenticated principal's name; may throw `NullReferenceException` for an anonymous request* |

### Output message

This operation declares no output message.

### Faults

| Fault | Surfaces as | Handled at the call site |
| --- | --- | --- |
| Generic SOAP fault | `FaultException` / `CommunicationException` / `TimeoutException` | Handled at the upstream caller — a bare `catch { }` in `SAIFExceptionLogger.Log` swallows every exception and falls back to `Trace.TraceError`, but the logging failure itself is not recorded anywhere |

### Call site

```csharp
webService.WriteError(detail.ToErrorInfoStruct());
```

| Aspect | Finding |
| --- | --- |
| Invocation frequency | Once per unhandled Web API exception |
| Result cached | No |
| Timeout at this call site | None — binding defaults apply |
| Retry at this call site | None |

### Notes
- The upstream caller's bare `catch { }` (`SAIFExceptionLogger.cs:18-37`) means a `NullReferenceException` while building `detail` — for example an anonymous request with a null `Principal` — is silently swallowed along with any genuine transport failure*.
- The `LoggingServiceProxy` instance constructed for this call is never disposed.

---

## WriteTrace

Declared by the WSDL to record an application, assembly, class, and method trace entry against the remote logging service; no repository source line invokes it.

| Field | Value |
| --- | --- |
| **Operation** | `WriteTrace` |
| **SOAP action** | `http://tempuri.org/SAIF/Logging/clsWSLogging/WriteTrace` |
| **Proxy member** | `void WriteTrace(TraceInfoStruct inTrace)` |
| **Input message** | `TraceInfoStruct` |
| **Output message** | None — one-way |
| **Declared faults** | None declared |
| **Called by** | No call site found in repository source |
| **Source** | `Services/SAIF.Services.Web.Proxies/Service References/Logging/clsWSLogging.wsdl` |

### Input message

| Part | Type | Required | Bound from | Purpose |
| --- | --- | --- | --- | --- |
| `ApplicationName` | `string` | Not stated in the WSDL | Not applicable — no call site | The logical application name |
| `AssemblyName` | `string` | Not stated in the WSDL | Not applicable — no call site | The assembly emitting the trace |
| `ClassName` | `string` | Not stated in the WSDL | Not applicable — no call site | The class emitting the trace |
| `DataText` | `string` | Not stated in the WSDL | Not applicable — no call site | Free-form trace payload |
| `Environment` | `string` | Not stated in the WSDL | Not applicable — no call site | The deployment track |
| `MachineName` | `string` | Not stated in the WSDL | Not applicable — no call site | The machine emitting the trace |
| `MethodName` | `string` | Not stated in the WSDL | Not applicable — no call site | The method emitting the trace |
| `MethodPosition` | `string` | Not stated in the WSDL | Not applicable — no call site | A position marker within the method |
| `PageName` | `string` | Not stated in the WSDL | Not applicable — no call site | The originating page |
| `TraceDate` | `dateTime` | Yes | Not applicable — no call site | When the trace entry was captured |
| `TraceID` | `string` | Not stated in the WSDL | Not applicable — no call site | A caller-assigned trace identifier |
| `UserName` | `string` | Not stated in the WSDL | Not applicable — no call site | The authenticated principal's name |

### Output message

This operation declares no output message.

### Faults

| Fault | Surfaces as | Handled at the call site |
| --- | --- | --- |
| Generic SOAP fault | Not applicable | Not applicable — this operation has no call site in repository source |

### Call site

No call site found in repository source.

### Notes
- The operation's purpose can only be inferred from its name and its `TraceInfoStruct` shape; no repository source calls it*.

---

## WriteAudit

Declared by the WSDL to record an application, page, and user audit message against the remote logging service; no repository source line invokes it.

| Field | Value |
| --- | --- |
| **Operation** | `WriteAudit` |
| **SOAP action** | `http://tempuri.org/SAIF/Logging/clsWSLogging/WriteAudit` |
| **Proxy member** | `void WriteAudit(AuditInfoStruct inAudit)` |
| **Input message** | `AuditInfoStruct` |
| **Output message** | None — one-way |
| **Declared faults** | None declared |
| **Called by** | No call site found in repository source |
| **Source** | `Services/SAIF.Services.Web.Proxies/Service References/Logging/clsWSLogging.wsdl` |

### Input message

| Part | Type | Required | Bound from | Purpose |
| --- | --- | --- | --- | --- |
| `ApplicationName` | `string` | Not stated in the WSDL | Not applicable — no call site | The logical application name |
| `AuditDate` | `dateTime` | Yes | Not applicable — no call site | When the audited action occurred |
| `DataText` | `string` | Not stated in the WSDL | Not applicable — no call site | Free-form audit payload |
| `Environment` | `string` | Not stated in the WSDL | Not applicable — no call site | The deployment track |
| `MachineName` | `string` | Not stated in the WSDL | Not applicable — no call site | The machine emitting the audit entry |
| `MessageText` | `string` | Not stated in the WSDL | Not applicable — no call site | The audit message |
| `PageName` | `string` | Not stated in the WSDL | Not applicable — no call site | The originating page |
| `UserName` | `string` | Not stated in the WSDL | Not applicable — no call site | The authenticated principal's name |

### Output message

This operation declares no output message.

### Faults

| Fault | Surfaces as | Handled at the call site |
| --- | --- | --- |
| Generic SOAP fault | Not applicable | Not applicable — this operation has no call site in repository source |

### Call site

No call site found in repository source.

### Notes
- The operation's purpose can only be inferred from its name and its `AuditInfoStruct` shape; no repository source calls it*.

---

## Coverage checklist

| Operation | Documented section | Called by |
| --- | --- | --- |
| `WriteTrace` | [`WriteTrace`](#writetrace) | No call site found in repository source |
| `WriteError` | [`WriteError`](#writeerror) | `LoggingServiceProxy.LogException` |
| `WriteAudit` | [`WriteAudit`](#writeaudit) | No call site found in repository source |

## Related documentation
- [Client index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Contract](contract.md)
- [Operation map](operation-map.md)
- [Consumption](consumption.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [Tech debt](tech-debt.md)

> **Note:** Statements marked with `*` were inferred from code structure or contextual
> evidence.

## Sources
- `Services/SAIF.Services.Web.Proxies/LoggingServiceProxy.cs`
- `Services/SAIF.Services.WebApi/EnvironmentApi/App_Start/SAIFExceptionLogger.cs`
- `Services/SAIF.Services.Web.Proxies/Service References/Logging/clsWSLogging.wsdl`
