Skip to content

DocumentServiceProxy

DocumentServiceProxy hides the internal generated clsGenerateSoapClient behind the xPression Design document workflow — preview, catalog listing, distribution (standard and DocCenter variants), and print — mapping SAIF.Core document, mail, and fax contract types to the wire types on every call. It is constructed by SAIF.Services.Utilities.Documents.DocumentService.

Purpose

  • Preview a rendered PDF for a document package before distribution (OP-WP-02).
  • List document categories and packages, always sorted ascending (WP-BR-005).
  • Distribute a document by email, fax, or deferred print, mapping enums by name and applying the standard-vs-DocCenter fax rules (WP-BR-006 through WP-BR-009).
  • Print a document directly, mapping print configuration onto the same underlying wire operation used for distribution.

Context

  • Namespace: SAIF.Services.Web.Proxies
  • Assembly/package: SAIF.Services.Web.Proxies (packaged in SAIF.SAIFCode.Core)

Public members

Member Signature Purpose
Constructor DocumentServiceProxy(string serviceUrl) Guards serviceUrl, then builds a BasicHttpBinding with MaxReceivedMessageSize/MaxArrayLength set to int.MaxValue (WP-BR-001)
PreviewPdf byte[] PreviewPdf(string package, string xml, string profile) Guards package/xml, then returns rendered PDF bytes from previewDocument, identifying the caller as "xPression Design" (WP-BR-004)
GetCategories string[] GetCategories() Returns the document categories available to the current user, sorted ascending (WP-BR-005)
GetPackages string[] GetPackages(string category) Returns the packages within a category, sorted ascending (WP-BR-005)
DistributeDocument void DistributeDocument(DocumentGenerationConfig docConfig, string printer, int copies, PlexMode plexMode, ScaleMode scaleMode, PaperTray paperTray, object imageImportSettings, MailMessage mailMessage, string faxInfo, DeferredPrintConfig deferredPrintConfig, string imagePath) Distributes a document by print/email/deferred-print; the faxInfo string parameter is always ignored, so fax is never sent through this method (WP-BR-008)
DistributeDocumentDocCenter void DistributeDocumentDocCenter(DocumentGenerationConfig docConfig, string printer, int copies, PlexMode plexMode, ScaleMode scaleMode, PaperTray paperTray, object imageImportSettings, MailMessage mailMessage, FaxInfoClass faxInfo, DeferredPrintConfig deferredPrintConfig, string imagePath) Distributes a document from DocCenter, sending fax info only when ToFaxNumber is present and using docConfig.ApplicationName when set (WP-BR-009)
PrintDocument void PrintDocument(DocumentGenerationConfig docConfig, PrintConfig printConfig) Prints a document directly, with null email/fax/deferred info and application "xPression Design"
Dispose void Dispose() Closes the underlying generated clsGenerateSoapClient by calling Close(), without an Abort() fallback on a faulted channel*

Behavioral notes

  • Enum mapping is performed by name via Helpers.MapEnumByName; an unmatched name throws ArgumentNullException (WP-BR-006).
  • DistributeDocumentDocCenter throws NullReferenceException on a null faxInfo argument, because MapFaxMessage dereferences it without a guard.
  • DistributeDocument's faxInfo string parameter is a documented parameter-mismatch finding: it exists on the signature but is never used to send a fax.

Constraints and usage notes

  • Callers must supply the endpoint URL; this wrapper reads no configuration of its own.
  • MailMessage/DeferredPrintConfig mapping tolerates a null input by producing a null output, so callers do not need to construct empty placeholder objects.

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/DocumentServiceProxy.cs
  • Services/SAIF.Services.Web.Proxies/Helpers.cs