Path: redb-route/redb.Route.Soap/SoapConnectionFactory.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Soap/SoapConnectionFactory.cs
----
using System.Security.Cryptography.X509Certificates;
using redb.Route.Core;
namespace redb.Route.Soap;
///
/// A SOAP service binding: WSDL/endpoint, version, data format, and WS-Security material. Registered once by
/// name in the route registry and referenced by .ConnectionFactory("name"), so certificates and
/// credentials never live in a URI (same pattern as AS2 / RabbitMQ).
///
public sealed class SoapConnectionFactory
{
///
/// Optional WSDL: a file path or inline XML. A consumer publishes it on GET ?wsdl (address rewritten
/// to the caller's URL). Not runtime-imported (.NET Core has no WSDL import) — it is the contract.
///
public string? Wsdl { get; set; }
/// Service endpoint URL to POST to (producer) or the public address (consumer).
public string EndpointUrl { get; set; } = "";
/// SOAP version. Drives Content-Type and SOAPAction placement.
public SoapVersion SoapVersion { get; set; } = SoapVersion.Soap11;
/// How the route sees the message. Default .
public SoapDataFormat DataFormat { get; set; } = SoapDataFormat.Payload;
/// Default SOAPAction when the exchange does not carry redbSoap.action.
public string? DefaultAction { get; set; }
// ── Transport TLS (consumer: how the endpoint is served) ──
///
/// Serve the receive endpoint over TLS. The scheme soaps says the same thing; this is here so a
/// deployment can turn TLS on together with the certificate it needs, in one registered place.
///
public bool Ssl { get; set; }
/// Path to the PFX certificate served on the TLS handshake.
public string? SslCertPath { get; set; }
/// Password for (redacted in logs and the dashboard).
[Sensitive] public string? SslCertPassword { get; set; }
/// Client-certificate policy (mTLS) for the receive endpoint.
public SoapClientCertificateMode ClientCertificateMode { get; set; } = SoapClientCertificateMode.NoCertificate;
///
/// Comma-separated thumbprints of accepted client certificates. Chain validation stays Kestrel's job;
/// this adds «and it must be one of ours», which is what pins a partner in a closed contour.
///
public string? AllowedClientThumbprints { get; set; }
// ── WS-Security (baseline: XML-Signature / XML-Encryption via System.Security.Cryptography.Xml) ──
/// Our certificate with private key: signs outgoing, decrypts incoming.
public X509Certificate2? SigningCert { get; set; }
/// Partner's public certificate: encrypts outgoing, verifies their signature.
public X509Certificate2? EncryptCert { get; set; }
/// UsernameToken user.
public string? Username { get; set; }
/// UsernameToken password (redacted in logs and the dashboard).
[Sensitive] public string? Password { get; set; }
///
/// Use MTOM/XOP for binary attachments. When set, a producer sends the message attachments
/// () as multipart/related and a consumer
/// replies with them; a consumer always parses inbound multipart/related into message attachments
/// regardless of this flag.
///
public bool Mtom { get; set; }
// ── Pojo dataFormat (typed serialization via XmlSerializer; DTOs may come from dotnet-svcutil) ──
///
/// Pojo mode: the CLR type the inbound request body deserializes into on a consumer. XML-serializable
/// (e.g. a dotnet-svcutil-generated DTO with [XmlRoot] matching the request element).
///
public Type? RequestType { get; set; }
///
/// Pojo mode: the CLR type the response body deserializes into on a producer (the reply object the route
/// receives). Overridable per message via the redbSoap.responseType header.
///
public Type? ResponseType { get; set; }
}