Skip to content

CleanAddressServiceBase

Abstract base for the CorrectAddress (USPS address-cleansing) service wrappers, holding the shared clsCAServices SOAP proxy client and configuring it for automatic redirects and default Windows credentials before any request is made. It implements IDisposable so callers of derived services (CleanAddressService, CleanAddressBatchService, AddressSearchService) can release the underlying web-service proxy deterministically.

Purpose

  • Validates that a non-null clsCAServices proxy is supplied to every derived service.
  • Configures the proxy (AllowAutoRedirect, UseDefaultCredentials) once, in a single place, for all CorrectAddress callers.
  • Provides a standard dispose pattern that releases the proxy connection.

Context

  • Namespace: SAIF.Services.Utilities.CleanAddress
  • Assembly/package: SAIF.Services (packaged inside the SAIF.SAIFCode.Core NuGet package)

Public members

Member Signature Purpose
Dispose() public void Dispose() Releases the underlying clsCAServices proxy connection exactly once and suppresses finalization.

Behavioral notes

  • The constructor eagerly sets AllowAutoRedirect = true and UseDefaultCredentials = true on the injected proxy via SetDefaults(), so every derived service always talks to CorrectAddress with the caller's Windows identity*.
  • Guards against double-disposal with an internal isDisposed flag before disposing the wrapped proxy.

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/Utilities/CleanAddress/CleanAddressServiceBase.cs