Path: redb-route/redb.Route.As4/As4Leg.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.As4/As4Leg.cs
----
namespace redb.Route.As4;
///
/// The business side of one leg of an agreement: which eb:Service and eb:Action a user
/// message on that leg carries. The request leg lives on itself; the reply leg of a
/// Two-Way / Push-and-Push exchange (required by eDelivery AS4 1.16) is .
///
public sealed class As4Leg
{
/// eb:CollaborationInfo/eb:Service.
public string? Service { get; set; }
/// eb:Service/@type; omitted when null.
public string? ServiceType { get; set; }
/// eb:CollaborationInfo/eb:Action.
public string? Action { get; set; }
/// Throws when the leg cannot describe a user message.
/// Name of the agreement and leg, for the error text.
internal void Validate(string owner)
{
if (string.IsNullOrWhiteSpace(Service))
throw new InvalidOperationException($"{owner}: Service is required.");
if (string.IsNullOrWhiteSpace(Action))
throw new InvalidOperationException($"{owner}: Action is required.");
}
}