Skip to content

Can I retrieve the original SBD Paypload? #268

@Kinchkun

Description

@Kinchkun

Cheers,

thank you for your work :)

I am developing a PEPPOL Access Point (AP) which stores retrieved documents in Amazon S3. For this, I am implementing the following interface:

fun handleIncomingSBD(
    @Nonnull aMessageMetadata: IAS4IncomingMessageMetadata,
    @Nonnull aHeaders: HttpHeaderMap,
    @Nonnull aUserMessage: Ebms3UserMessage,
    @Nonnull aSBDBytes: ByteArray,
    @Nonnull aSBD: StandardBusinessDocument,
    @Nonnull aPeppolSBD: PeppolSBDHData,
    @Nonnull aState: IAS4MessageState,
    @Nonnull aProcessingErrorMessages: ICommonsList<Ebms3Error>,
) {
    val payloadBytes = serializeElement(aSBD.any as Element)
    s3.storeBytes(payloadBytes)
}

I only want the payload and not the SBD itself.

What I don't like about this solution is that we retrieve the SBD bytes, parse it into an XML tree, and then serialize part of the tree back into bytes.

Is there a way to access the original payload bytes? The serialization and deserialization process slightly alters the original message, not in a meaningful way, but I need to store the byte-wise exact original message somehow.

Kind regards,

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions