CustomPartProps needs to be added to payloads and attachments for WSS4JAttachment when using the Phase4XXXSender.Builder
#276
-
to reflect this XML structure: Builder doesn't seem to allow for extra property addition. @phax Is there any other mechanism to customize outgoing envelope? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Agree. The class for the outgoing attachment needs this property. |
Beta Was this translation helpful? Give feedback.
-
@phax would be nice.. so far I have managed to fork and override: @Nullable
@OverrideOnDemand
protected WSS4JAttachment createMainAttachment (@Nonnull final AS4OutgoingAttachment aPayload,
@Nonnull final AS4ResourceHelper aResHelper) throws IOException
{
WSS4JAttachment attachment = WSS4JAttachment.createOutgoingFileAttachment (aPayload, aResHelper);
attachment.customPartProperties().addAll(((MockAS4OutgoingAttachment) aPayload).getProperties());
return attachment;
}
@Nullable
@OverrideOnDemand
protected WSS4JAttachment createOtherAttachment (@Nonnull final AS4OutgoingAttachment aPayload,
@Nonnull final AS4ResourceHelper aResHelper,
@Nonnegative final int nAttachmentIndex) throws IOException
{
WSS4JAttachment attachment = WSS4JAttachment.createOutgoingFileAttachment (aPayload, aResHelper);
attachment.customPartProperties().addAll(((MockAS4OutgoingAttachment) aPayload).getProperties());
return attachment;
} While |
Beta Was this translation helpful? Give feedback.
Thanks, will do a fix for the 2.x branch to add custom properties as well