/// <summary> /// Initializes a new instance of the <see cref="SignalMessage"/> class. /// </summary> /// <param name="messageId"></param> /// <param name="refToMessageId"></param> /// <param name="routedUserMessage"></param> protected SignalMessage( string messageId, string refToMessageId, RoutingInputUserMessage routedUserMessage) : this(messageId, refToMessageId, DateTimeOffset.Now, routedUserMessage) { }
/// <summary> /// Initializes a new instance of the <see cref="Receipt"/> class. /// </summary> /// <param name="messageId">The ebMS message identifier of this message unit.</param> /// <param name="refToMessageId">The reference to an ebMS message identifier of an <see cref="Core.UserMessage"/>.</param> /// <param name="nonRepudiation">The non-repudiation information containing the signed references of the <see name="Core.UserMessage"/>.</param> /// <param name="routedUserMessage">The <see cref="Core.UserMessage"/> to include in the receipt in the form of a RoutingInput element.</param> internal Receipt( string messageId, string refToMessageId, NonRepudiationInformation nonRepudiation, RoutingInputUserMessage routedUserMessage) : this(messageId, refToMessageId, DateTimeOffset.Now, nonRepudiation, routedUserMessage) { }
/// <summary> /// Initializes a new instance of the <see cref="SignalMessage"/> class. /// </summary> /// <param name="messageId"></param> /// <param name="refToMessageId"></param> /// <param name="timestamp"></param> /// <param name="routedUserMessage"></param> protected SignalMessage( string messageId, string refToMessageId, DateTimeOffset timestamp, RoutingInputUserMessage routedUserMessage) : base(messageId, refToMessageId, timestamp) { MultiHopRouting = (routedUserMessage != null).ThenMaybe(routedUserMessage); }
/// <summary> /// Initializes a new instance of the <see cref="Receipt"/> class. /// </summary> /// <param name="messageId">The ebMS message identifier of this message unit.</param> /// <param name="refToMessageId">The reference to an ebMS message identifier of an <see cref="Core.UserMessage"/>.</param> /// <param name="timestamp">The timestamp when this receipt is created.</param> /// <param name="includedUserMessage">The <see cref="Core.UserMessage"/> for which this receipt is created.</param> /// <param name="routedUserMessage">The <see cref="Core.UserMessage"/> to include in the receipt in the form of a RoutingInput element.</param> internal Receipt( string messageId, string refToMessageId, DateTimeOffset timestamp, UserMessage includedUserMessage, RoutingInputUserMessage routedUserMessage) : base(messageId, refToMessageId, timestamp, routedUserMessage) { UserMessage = includedUserMessage; }
/// <summary> /// Initializes a new instance of the <see cref="Receipt"/> class. /// </summary> /// <param name="messageId">The ebMS message identifier of this message unit.</param> /// <param name="refToMessageId">The reference to an ebMS message identifier of an <see cref="Core.UserMessage"/>.</param> /// <param name="timestamp">The timestamp when this receipt is created.</param> /// <param name="nonRepudiation">The non-repudiation information containing the signed references of the <see name="Core.UserMessage"/>.</param> /// <param name="routedUserMessage">The <see cref="Core.UserMessage"/> to include in the receipt in the form of a RoutingInput element.</param> internal Receipt( string messageId, string refToMessageId, DateTimeOffset timestamp, NonRepudiationInformation nonRepudiation, RoutingInputUserMessage routedUserMessage) : base(messageId, refToMessageId, timestamp, routedUserMessage) { NonRepudiationInformation = nonRepudiation; }
/// <summary> /// Initializes a new instance of the <see cref="Error"/> class. /// </summary> /// <param name="messageId">The ebMS message identifier of this message unit.</param> /// <param name="refToMessageId">The reference to an ebMS message identifier of an <see cref="Core.UserMessage"/>.</param> /// <param name="timestamp">The timestamp when this receipt is created.</param> /// <param name="lines">The sequence of error entries to include in this error.</param> /// <param name="routedUserMessage">The <see cref="Core.UserMessage"/> to include in the error in the form of a RoutingInput element.</param> internal Error( string messageId, string refToMessageId, DateTimeOffset timestamp, IEnumerable <ErrorLine> lines, RoutingInputUserMessage routedUserMessage) : base(messageId, refToMessageId, timestamp, routedUserMessage) { if (lines == null || lines.Any(l => l is null)) { throw new ArgumentNullException(nameof(lines)); } ErrorLines = lines; }
private static void AssertIfSenderAndReceiverAreReversed(AS4Message expectedAS4Message, XmlNode doc) { XmlNode routingInputNode = doc.UnsafeSelectEbmsNode("/s12:Envelope/s12:Header/mh:RoutingInput"); Assert.NotNull(routingInputNode); var routingInput = AS4XmlSerializer.FromString <RoutingInput>(routingInputNode.OuterXml); RoutingInputUserMessage actualUserMessage = routingInput.UserMessage; UserMessage expectedUserMessage = expectedAS4Message.FirstUserMessage; Assert.Equal(expectedUserMessage.Sender.Role, actualUserMessage.PartyInfo.To.Role); Assert.Equal( expectedUserMessage.Sender.PartyIds.First().Id, actualUserMessage.PartyInfo.To.PartyId.First().Value); Assert.Equal(expectedUserMessage.Receiver.Role, actualUserMessage.PartyInfo.From.Role); Assert.Equal( expectedUserMessage.Receiver.PartyIds.First().Id, actualUserMessage.PartyInfo.From.PartyId.First().Value); }