---
title: Consumption
summary: How a consuming application references, constructs, calls, and disposes the proxy.
status: draft
owner: SAIF.Core documentation
last_reviewed: 2026-09-24
---

# Consumption

A consumer must construct the authored `WorkCalendarServiceProxy` wrapper directly, supplying its own service URL; no repository code in this repository currently does so. `SAIF.Services.Web.Proxies`, the library that carries this proxy, is itself consumed as a library within this run — see [`saif-services-web-proxies`](../../libraries/saif-services-web-proxies/overview.md).

## Reference style

| Field | Value |
| --- | --- |
| Mechanism | Service Reference (svcutil) |
| Declared in | `Services/SAIF.Services.Web.Proxies/SAIF.Services.Web.Proxies.csproj` |
| Generated artifacts | `Services/SAIF.Services.Web.Proxies/Service References/WorkCalendar/` |
| Target framework | .NET Framework 4.6.2 |
| Regeneration command | Visual Studio "Update Service Reference" |

## Construction

```csharp
var client = new SAIFDatesSoapClient(new BasicHttpBinding(), new EndpointAddress(serviceUrl));
```

| Step | Requirement |
| --- | --- |
| Endpoint address | Supplied by the caller of `WorkCalendarServiceProxy`'s constructor (`serviceUrl` argument, validated with `Enforce.ArgumentNotNullOrWhiteSpace`); no repository source supplies one |
| Binding | Constructed in code (`new BasicHttpBinding()`, all defaults) |
| Credentials | None |
| Initialization | Single-constructor — `WorkCalendarServiceProxy(serviceUrl)` |

## Endpoint configuration

| Setting | Value | Source | Changeable without a rebuild |
| --- | --- | --- | --- |
| Endpoint address | Unresolved** — caller-supplied `serviceUrl` | `WorkCalendarServiceProxy.cs:12-19` | Yes — it is a constructor argument, not a literal |
| Binding configuration | Constructed in code (all defaults) | `WorkCalendarServiceProxy.cs:16-19` | No — changing binding settings requires a rebuild |
| Security mode | `None` (default) | `WorkCalendarServiceProxy.cs:17` | No |

## Resilience

| Concern | Finding | Configurable by consumer | Source | Tech debt |
| --- | --- | --- | --- | --- |
| Timeout | None configured — binding defaults apply | No | `WorkCalendarServiceProxy.cs:16-19` | Yes |
| Retry | None configured | No | — | Yes |
| Circuit breaking | None configured | No | — | Yes |
| Thread safety | Not determined from source | — | — | No |
| Cancellation | Not supported — no cancellation on any call site | — | `WorkCalendarServiceProxy.cs:25,30,36,42` | Yes |
| Message size limits | `65536` bytes (`BasicHttpBinding` default) | No | `WorkCalendarServiceProxy.cs:16-19` | No |

There is no client-side retry, so a transient failure fails the single attempt outright — significant because the date lookups are idempotent and could safely be retried or cached, but neither is done*. There is no explicit timeout, so the call relies on the `BasicHttpBinding` framework defaults.

## Disposal

| Aspect | Finding |
| --- | --- |
| Disposal performed | `Close()` only |
| Faulted channel handled | No — a faulted channel throws from `Close()` and masks the original failure* |
| Wrapper responsibility | `WorkCalendarServiceProxy` disposes the generated client |
| Source | `Services/SAIF.Services.Web.Proxies/WorkCalendarServiceProxy.cs:49-65` |

```csharp
public void Dispose()
{
    _webService.Close();
}
```

## Error handling for consumers

| Failure | Surfaces as | Consumer action |
| --- | --- | --- |
| Service unreachable | `EndpointNotFoundException`* | Not handled by the wrapper — propagates to the consumer |
| SOAP fault returned | `FaultException`* | Not handled by the wrapper — propagates to the consumer |
| Timeout exceeded | `TimeoutException`* | Not handled by the wrapper — propagates to the consumer |
| Response larger than the message size limit | `CommunicationException` (quota exceeded)* — unlikely given primitive-typed responses | Not handled by the wrapper |
| Empty or absent output message | Not applicable — every operation returns a required primitive | — |

## Usage examples

No repository source constructs or calls `WorkCalendarServiceProxy`, so no in-repository usage example can be drawn from a call site. The following example is **illustrative** — assembled from the wrapper's actual constructor, method, and `Dispose()` implementations shown in [Construction](#construction) and [Disposal](#disposal) above — and shows how a consumer would construct, call, and dispose the wrapper if one existed.

```csharp
// Illustrative example — assembled from WorkCalendarServiceProxy.cs; no repository source performs this sequence today.
using (var calendar = new WorkCalendarServiceProxy(serviceUrl))
{
    bool isWorkDay = calendar.IsWorkingDay(DateTime.Today, "SAIF");
    DateTime next = calendar.NextWorkDay(DateTime.Today, "SAIF");
} // Dispose() calls _webService.Close()
```

| Scenario | Operations used | Notes |
| --- | --- | --- |
| Illustrative working-day check and next-work-day lookup | `IsWorkingDay`, `NextWorkDay` | Assembled from `WorkCalendarServiceProxy.cs:12-19,28-31,40-43,49-65`; not exercised by any caller in this repository |

## Lifecycle guidance

| Question | Answer |
| --- | --- |
| Construct once or per call | Not determined from source — no in-repository caller exists |
| Disposable | Yes (`IDisposable`) |
| Safe to share across threads | Not determined from source |

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

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `Services/SAIF.Services.Web.Proxies/WorkCalendarServiceProxy.cs`
- `Services/SAIF.Services.Web.Proxies/app.config`
