Getting a decoding error when calling the decodeToXml of a request message

I am using UPAJ to encode a request message that contains Key
Attribute with the ELEMENT_LIST data type and Payload with the FILED_LIST data
type. (Mix of data type)

Before I send this message to a provider, I want to print the
message in XML format but when I call the Msg.decodeToXml method, I always get
the error like this.

<REQUEST domainType="129" streamId="5" containerType="FIELD_LIST" flags="0x106
(HAS_PRIORITY|STREAMING|PRIVATE_STREAM)" priorityClass="1"priorityCount="1" dataSize="28">
<key flags="0x23 (HAS_SERVICE_ID|HAS_NAME|HAS_ATTRIB)" serviceId="4443"
name="TRI" attribContainerType="ELEMENT_LIST">
<attrib>
<elementList flags="0x08 (HAS_STANDARD_DATA)">
<elementEntry name="ApplicationId" dataType="ASCII_STRING" data="256"/>
</elementList>
</attrib>
</key>
<dataBody>
<fieldList flags="0x08 (HAS_STANDARD_DATA)">
Error occurred while decoding FieldEntry, CodecReturnCode=-26
</dataBody>
</REQUEST>

However, this message is
sent successfully to a provider and the provider can decode it correctly.

What is the meaning of this error message?

Best Answer

  • Msg.decodeToXml() is used to decodes all containers within the message to XML.

    From the error message, it indicates that it is unable to decode the FieldEntry inside the payload of the message.

    I have verified the problem and found that it is a bug in Msg.decodeToXml() in UPA Java 8.0.0.L1 and below. The development team will fix this issue in the next UPA Java release.

    In conclusion, if you found this error message, it could be a bug in Msg.decodeToXml(), not in the encoding logic. You can verify this by using DecodeIterator to decode the message. If DecodeIterator can properly decode all containers within the message, you can ignore this error and use the message.