B
BobNoobGuy
Guest
This is my XML
This is my code trying to read it into a dataset
And this is the error I get.
I also tried with different namespace like this:
or
or
But still getting the same error. please help thank you
Continue reading...
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Message xmlns:ns1="http://API.JOEJANE.Envelope">
<ns1:MessageHeader>
<ns1:MessageId>ce82fe4f-c843-57a6-14a1-15d79773b638</ns1:MessageId>
<ns1:From>ABC</ns1:From>
<ns1:To>JOEJANE</ns1:To>
<ns1:PlantId>7301</ns1:PlantId>
</ns1:MessageHeader>
</ns1:Message>
This is my code trying to read it into a dataset
Code:
def temp-table ttMsgHdr no-undo serialize-name "ns1:MessageHeader"
field MsgId as char serialize-name "ns1:MessageId"
field MsgFrom as char serialize-name "ns1:From"
field MsgTo as char serialize-name "ns1:To"
field PlantId as char serialize-name "ns1:PlantId".
def dataset dsONE xml-node-name "ns1:Message" for
ttMsgHdr.
def var dXml as longchar.
dataset dsONE:read-xml("longchar",dXml,"empty",?,?,?,?).
find first ttMsgHdr no-error.
And this is the error I get.
DATASET name 'ns1:Message' in namespace '' not found in XML Document.
I also tried with different namespace like this:
Code:
def dataset dsONE xml-node-name "" for
ttMsgHdr.
or
Code:
def dataset dsONE xml-node-name "ns1:Message xmlns:ns1=""http://API.JOEJANE.Envelope""" for
ttMsgHdr.
or
Code:
def dataset dsONE xml-node-name "ns1:Message xmlns:ns1" for
ttMsgHdr.
But still getting the same error. please help thank you
Continue reading...