Hi,
I'm trying to convert DLMS hex-string to XML using GXDLMSTranslator. Sometimes it appears that MessageToXml method returns string, which is not a proper XML-formatted data.
The reason is that your data is not valid DLMS PDU. Because LLC bytes are missing I believe that your PDU is coming in frames and the previous frame is missing. Because part of the data is missing, data can't be shown as XML. You need to give all frames to the parser so it can be parsed.
However I'd like to be a little more specific: indeed, my posted example is one of a multi-part response, and each separate part of that pesponse contains valid XML, except of one part. Here they are:
First 5 frames contains node <NextFrame> with hex-string in attribute Value. I have no problem with collecting all this strings by parsing XML, so I eventually will have a whole piece of data to work with. But in frame 6 - there's a invalid XML (which I mentioned in my original post), and my XML-parser fails.
So this is my problem - why one of the parts of the response is invalid XML ?
BTW, after frame 6 - there's 2 more frames (parts of the response), again with valid XML, i.e. with node <NextFrame> and hex-string in attribute Value.
There are several blocks and here is only the first one. You need to read all the blocks before you can parse the data. There is data only for 3 first rows and there should be 4 rows.
Also, there should be 713 bytes in this block, but there are only 712 bytes. You need to check what is causing that.
Hi,
Hi,
The reason is that your data is not valid DLMS PDU. Because LLC bytes are missing I believe that your PDU is coming in frames and the previous frame is missing. Because part of the data is missing, data can't be shown as XML. You need to give all frames to the parser so it can be parsed.
BR,
Mikko
Hi,
Hi,
thanks for quick response !
However I'd like to be a little more specific: indeed, my posted example is one of a multi-part response, and each separate part of that pesponse contains valid XML, except of one part. Here they are:
<HDLC len="134" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="BE" />
<NextFrame Value="C402C10000000001008202C90104021A090C07E5061501000000008000001500000000002353A41500000000000000001500000000000000001500000000000000001500000000002353A415000000000001F93A15000000000000000015000000000000000015000000000000000015000000000001F93A1500" />
</HDLC>
<HDLC len="134" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="B0" />
<NextFrame Value="0000000007C60815000000000000000015000000000000000015000000000000000015000000000007C60815000000000003A7C215000000000000000015000000000000000015000000000000000015000000000003A7C21500000000002353A415000000000001F93A15000000000007C60815000000000003A7C206" />
</HDLC>
<HDLC len="134" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="B2" />
<NextFrame Value="00000012021A090C07E50616020000000080000015000000000026C72415000000000000000015000000000000000015000000000000000015000000000026C72415000000000001F93A15000000000000000015000000000000000015000000000000000015000000000001F93A15000000000007C608150000000000" />
</HDLC>
<HDLC len="134" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="B4" />
<NextFrame Value="00000015000000000000000015000000000000000015000000000007C60815000000000004807D15000000000000000015000000000000000015000000000000000015000000000004807D15000000000026C72415000000000001F93A15000000000007C60815000000000004807D0600000012021A090C07E5061703" />
</HDLC>
<HDLC len="134" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="B6" />
<NextFrame Value="000000008000001500000000002A1F3E1500000000000000001500000000000000001500000000000000001500000000002A1F3E15000000000001F93A15000000000000000015000000000000000015000000000000000015000000000001F93A15000000000007C60815000000000000000015000000000000000015" />
</HDLC>
<HDLC len="112" >
<TargetAddress Value="16" />
<SourceAddress Value="144" />
<!--I frame.-->
<FrameType Value="B8" />
<PDU>
<Data="0000000000000015000000000007C6081500000000000567241500000000000000001500000000000000001500000000000000001500000000000567241500000000002A1F3E15000000000001F93A15000000000007C6081500000000000567240600000012" />
</PDU>
</HDLC>
First 5 frames contains node <NextFrame> with hex-string in attribute Value. I have no problem with collecting all this strings by parsing XML, so I eventually will have a whole piece of data to work with. But in frame 6 - there's a invalid XML (which I mentioned in my original post), and my XML-parser fails.
So this is my problem - why one of the parts of the response is invalid XML ?
BTW, after frame 6 - there's 2 more frames (parts of the response), again with valid XML, i.e. with node <NextFrame> and hex-string in attribute Value.
Hi,
Hi,
There are several blocks and here is only the first one. You need to read all the blocks before you can parse the data. There is data only for 3 first rows and there should be 4 rows.
Also, there should be 713 bytes in this block, but there are only 712 bytes. You need to check what is causing that.
BR,
Mikko