XER: Untagged optional union decoding [message #1850273] |
Wed, 23 February 2022 14:38 |
Moritz Klass Messages: 22 Registered: August 2020 |
Junior Member |
|
|
Hello,
I got the following situation:
I have an untagged optional union, followed by an untagged union.
Like that:
type record ChargeParameterDiscoveryResType
{
ResponseCodeType responseCode,
EVSEProcessingType eVSEProcessing,
SASchedules_group sASchedules optional,
EVSEChargeParameter_group eVSEChargeParameter
}
with {
variant (responseCode) "name as capitalized";
variant (eVSEProcessing) "name as capitalized";
variant (sASchedules) "name as capitalized";
variant (sASchedules) "namespace as 'urn:iso:15118:2:2013:MsgDataTypes' prefix 'v2gci_t'";
variant (eVSEChargeParameter) "name as capitalized";
variant (eVSEChargeParameter) "namespace as 'urn:iso:15118:2:2013:MsgDataTypes' prefix 'v2gci_t'";
};
while the elements in question look like this:
type union SASchedules_group
{
SASchedulesType sASchedules,
SAScheduleList sAScheduleList
}
with {
variant "untagged";
variant (sASchedules) "name as capitalized";
variant (sASchedules) "form as qualified";
variant (sASchedules) "abstract";
variant (sAScheduleList) "name as capitalized";
};
type union EVSEChargeParameter_group
{
EVSEChargeParameterType eVSEChargeParameter,
AC_EVSEChargeParameter aC_EVSEChargeParameter,
DC_EVSEChargeParameter dC_EVSEChargeParameter
}
with {
variant "untagged";
variant (eVSEChargeParameter) "name as capitalized";
variant (eVSEChargeParameter) "form as qualified";
variant (eVSEChargeParameter) "abstract";
variant (aC_EVSEChargeParameter) "name as capitalized";
variant (dC_EVSEChargeParameter) "name as capitalized";
};
The error occurs while XER decoding the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<ns7:V2G_Message xmlns:ns7="urn:iso:15118:2:2013:MsgDef" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.w3.org/2001/XMLSchema" xmlns:ns4="http://www.w3.org/2000/09/xmldsig#" xmlns:ns5="urn:iso:15118:2:2013:MsgBody" xmlns:ns6="urn:iso:15118:2:2013:MsgDataTypes" xmlns:ns8="urn:iso:15118:2:2013:MsgHeader">
<ns7:Header>
<ns8:SessionID>C9251236900EE3F8
</ns8:SessionID>
</ns7:Header>
<ns7:Body>
<ns5:ChargeParameterDiscoveryRes>
<ns5:ResponseCode>FAILED_UnknownSession</ns5:ResponseCode>
<ns5:EVSEProcessing>Finished</ns5:EVSEProcessing>
<ns6:AC_EVSEChargeParameter>
<ns6:AC_EVSEStatus>
<ns6:NotificationMaxDelay>0</ns6:NotificationMaxDelay>
<ns6:EVSENotification>None</ns6:EVSENotification>
<ns6:RCD>false</ns6:RCD>
</ns6:AC_EVSEStatus>
<ns6:EVSENominalVoltage>
<ns6:Multiplier>0</ns6:Multiplier>
<ns6:Unit>V</ns6:Unit>
<ns6:Value>230</ns6:Value>
</ns6:EVSENominalVoltage>
<ns6:EVSEMaxCurrent>
<ns6:Multiplier>0</ns6:Multiplier>
<ns6:Unit>A</ns6:Unit>
<ns6:Value>32</ns6:Value>
</ns6:EVSEMaxCurrent>
</ns6:AC_EVSEChargeParameter>
</ns5:ChargeParameterDiscoveryRes>
</ns7:Body>
</ns7:V2G_Message
The error is the following: Dynamic test case error: While XER-decoding type '@urn_iso_15118_2_2013_MsgDef.V2G_Message': Component 'body': Component 'bodyElement': Alternative 'chargeParameterDiscoveryRes': Component 'sASchedules': 'AC_EVSEChargeParameter' does not match any alternative
The decoder seems to look at plcaing the AC_EVSEChargeParameter into the sASchedules component which is wrong since it is not present.
It looks kind of similar like this really old bug:
https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/212
Please tell me which information you need addionally so that I can provide it.
I am on Titan 7.2.1-final since I can not upgrade due to this behavior:
https://www.eclipse.org/forums/index.php/t/1109877/
But on first glance it does not seem that this is fixed in the newer version.
Thank you, best regards
Moritz
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05546 seconds