holodeck-b2b/Holodeck-B2B

EBMS:0003 The payload could not be found in message when using soap body containment

Opened this issue · 2 comments

When sending an AS4 message from Axway B2Bi (v2.6) to HolodeckB2B (v5.0.3) using the SOAP body as the payload location HolodeckB2B returns a SignalMessage with errorCode EBMS:0003, severity failure and detail "The payload could not be found in the message!".

I've pinpointed the problem to the following: in the doProcessing method of the SaveUserMsgAttachments class the BODY containment case handles two situations:

  1. the PartInfo has no href attribute (or it is empty). In this case the first element within the SOAP body is used as the payload.
  2. the PartInfo has an href attribute. In this case the children of the SOAP body element are scanned to find the element matching the id in the href.

However, the message that Axway B2Bi sends out is a third case, where the PartInfo has an href attribute that matches the id (wsu:Id) of the SOAP body element itself. This is exactly the case shown in Appendix A.1 User Message of this document:
See http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/profiles/AS4-profile/v1.0/os/AS4-profile-v1.0-os.pdf
Line 843: <eb:PartInfo href="#_f8aa8b55-b31c-4364-94d0-3615ca65aa40"/>
references line 851: <S12:Body wsu:Id="_f8aa8b55-b31c-4364-94d0-3615ca65aa40">

We're using HolodeckB2B 5.0.3, but the relevant code for 6.1.0 is the same.

Some more info:
The core ebMS 3.0 spec mentions "an xml:id fragment identifier" (under 13 PartInfo):
https://docs.oasis-open.org/ebxml-msg/ebms/v3.0/core/os/ebms_core-3.0-spec-os.html#5.2.2.eb:Messaging/eb:UserMessage|outline

But that would also not work if it refers to the soap body element, holodeck currently only processes the whole soap body if the href is absent. The wsu:Id on the soap body element in the AS4 profile example in A.1 stems from the WSS spec:
https://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-errata-os-SOAPMessageSecurity.htm

"All receivers MAY be able to identify XML elements with a xml:id attribute as representing an ID attribute and process it accordingly. Senders SHOULD use wsu:Id and MAY use xml:id. Note that use of xml:id in conjunction with inclusive canonicalization may be inappropriate, as noted in [XMLID] and thus this combination SHOULD be avoided."

The above, together with the fact that the example uses the wsu:id on the PartInfo href, might mean it is best to check if the partinfo href matches either the wsu:Id or xml:id when searching for the payload in the body.

Hi @gtalman,
the ebMS specification unfortunately leaves room for interpretation how these references shoud be handled, see also issue 84 in the issue tracker of the OASIS ebMS TC.. As described in that issue the reference should point to the payload of the message. This however is not the SOAP Body element itself, but the first child element of it. Therefore HB2B does only search the child elements for the referenced id.

But as noted in the OASIS issue one can indeed also assume that a reference to the SOAP Body element should be interpreted as a reference to the first child element. Therefore it is indeed a good idea to also implement this option as well to increase interop between implementations.