Skip to Content

Why does missing Root Node mapping cause 'Value missing in the context' error?

Consider a message type as:

User          1..1
|_ Address    0..*

For the simplicity, let's consider that both components use this message type.

If 'User' (the root node) is mapped one-to-one, then mapping is successful. However, not mapping the root node causes 'Cannot create target element .... Values missing in queue context ....' error.

Why is it necessary to map root node?

Please could you direct me towards documentation explaining this.

Kind regards,

Bala

Add comment
10|10000 characters needed characters exceeded

  • More clarification:

    Consider this data type:

    User          1..1
      Name        0..1
      Address     0..*

    When root node is not mapped:

    For following input, no errors happen.

    <User>
       <Name>Bhalchandra</Name>
       <Address>SAP Community</Address>
    </User>

    For following input, error happens:

    <User>
        <Name>Bhalchandra</Name>
        <!-- Notice the missing Address node here>
    </User>

    Notice the missing Address node. However, the Address node is optional on both sides.

    When root node is mapped, missing Address node does not cause any issues.

    Why does not mapping root node causes 'Value missing in queue context' error when on target side the element is optional?

  • Get RSS Feed

1 Answer

  • Feb 13 at 08:58 PM

    Hi Bala,

    This is not because of root or child elements. This error is because of occurrence of User as 1..1. Change it to 0..1 or 0..unbounded, you will not get error.

    If occurance of any element is 1..1 or 1..unbounded means its mandatory in target message and has at least one value for that.

    Regards,

    Anoop

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Anoop.

      Sorry for not giving exhaustive example at first. I have updated the example in the comment. Hope this will remove any ambiguities.

      Please could you have a look?