VDF 15.1
I need to read data from an XML. I need the information contained in some of XML's tag. Four's tag: "certificate", "context", "FIELDS", "token". The <FIELDS> tag has two other tag's: "key" and "value"
<FIELDS> The tag is of type array of data and can vary the amount of child tags.
Below is the XML file:
Code:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:executeResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://webservice.pamcard.jee.pamcary.com.br"> <executeReturn href="#id0"></executeReturn> </ns1:executeResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ResponseTO" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://webservice.to.core.jee.hst.com.br"> <certificate xsi:type="soapenc:base64Binary">MIIC8z...</certificate> <context xsi:type="soapenc:string">FindFavored</context> <fields soapenc:arrayType="ns2:FieldTO[2]" xsi:type="soapenc:Array"> <fields href="#id1"></fields> <fields href="#id2"></fields> </fields> <token xsi:type="soapenc:string" xsi:nil="true"></token> </multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:FieldTO" xmlns:ns3="http://webservice.to.core.jee.hst.com.br" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <key xsi:type="soapenc:string">mensagem.descricao</key> <value xsi:type="soapenc:string">Empresa não existe</value> </multiRef> <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:FieldTO" xmlns:ns4="http://webservice.to.core.jee.hst.com.br" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <key xsi:type="soapenc:string">mensagem.codigo</key> <value xsi:type="soapenc:string">4</value> </multiRef> </soapenv:Body> </soapenv:Envelope>
I need to read this information and throw them in a variable array of struct.
Code:Struct tWSFieldTO String key Variant value End_Struct // tWSFieldTO Struct tWSResponseTO Variant certificate String context tWSFieldTO[] fields String token End_Struct // tWSResponseTO
Can anyone help me develop a routine to read this information from the XML file?
Someone has done something similar, have any examples?
Any help is welcome.