cleanair4me46
Technical User
I am trying to take apart the below XML but cant get it work:
If I change the xml to this below format it works:
Here is the server side I am using:
Code:
<?xml version = "1.0" ?
<SOAP-ENV:Envelope ....>
<SOAP-ENV:Body ....>
<PeopleAction>
<PersonData>
<Person>
<id>1</id>
<city>San Jose</city>
<state>California</state>
</Person>
</PersonData>
</PeopleAction>
</SOAP-ENV:Envelope ....>
</SOAP-ENV:Body ....>
If I change the xml to this below format it works:
Code:
<?xml version = "1.0" ?
<SOAP-ENV:Envelope ....>
<SOAP-ENV:Body ....>
<PersonData>
<Person category="friend">
<id>1</id>
<city>San Jose</city>
<state>California</state>
</Person>
</PersonData>
</SOAP-ENV:Envelope ....>
</SOAP-ENV:Body ....>
Here is the server side I am using:
Code:
xmlfile = xmlparse(myxmlfilehere.xml);
xmlsize = arraylen(xmlfile.Person.xmlchildren);
xmlqry = QueryNew("id, city, state");
QueryAddRow(xmlqry,xmlsize);
for(a=1;a LTE xmlsize;a=a+1) {
QuerySetCell(xmlqry,"city",xmlfile.Person.PersonID[a].City.xmlText,a);
QuerySetCell(xmlqry,"state",xmlfile.Person.PersonID[a].State.xmlText,a);
QuerySetCell(xmlqry,"id",xmlfile.Person.PersonID[a].xmlAttributes.id,a);
//xmlfile.Person.PersonID[a].xmlAttributes.id gets the value of the attribute in the tag
}