Php -> Xml -> Wddx

webmasterbeta

New Member
I don't have any XML programming knowledge so forgive me if these questions are below your level or are annoying!

I have to send an XML request to an external URL and then parse the results, which are in WDDX XML format.

the requests have to have the following variables
USERNAME
PASSWORD
TYPE (set to 'ER')
and then one or more of these:
FORENAME,
SURNAME,
DOORNO
STREET
VILLAGE
TOWN
COUNTY
POSTCODE


The data format for the results is:

<wddxPacket version='1.0'>

<header></header>

<data>

<struct>

<var name='BT'>

<recordset rowCount='0' fieldNames='FORENAME,SURNAME,NAME,COMPANY,SUB,BUSDESC,SUBBUILD,BUILDING,DOORNO,STREET,VILLAGE,POSTTO WN,COUNTY,POSTCODE,TELEPHONE,LINE_TYPE,TARIFF'>

<field name='FORENAME'></field>

<field name='SURNAME'></field>

<field name='NAME'></field>

<field name='COMPANY'></field>

<field name='SUB'></field>

<field name='BUSDESC'></field>

<field name='SUBBUILD'></field>

<field name='BUILDING'></field>

<field name='DOORNO'></field>

<field name='STREET'></field>

<field name='VILLAGE'></field>

<field name='POSTTOWN'></field>

<field name='COUNTY'></field>

<field name='POSTCODE'></field>

<field name='TELEPHONE'></field>

<field name='LINE_TYPE'></field>

<field name='TARIFF'></field>

</recordset>

</var>

<var name='BU'>

<recordset rowCount='0' fieldNames='COMPANY,LOB,SIC,HOUSENAME,DOORNO,STREET,VILLAGE,TOWN,COUNTY,POSTCODE,TELEPHONE,FAX'>

<field name='COMPANY'></field>

<field name='LOB'></field>

<field name='SIC'></field>

<field name='HOUSENAME'></field>

<field name='DOORNO'></field>

<field name='STREET'></field>

<field name='VILLAGE'></field>

<field name='TOWN'></field>

<field name='COUNTY'></field>

<field name='POSTCODE'></field>

<field name='TELEPHONE'></field>

<field name='FAX'></field>

</recordset>

</var>

<var name='ER'>

<recordset rowCount='0' fieldNames='FORENAME,SURNAME,INIT,SUBBUILD,BUILDNAME,DOORNO,STREET,VILLAGE,TOWN,COUNTY,POSTCODE,TELE PHONE'>

<field name='FORENAME'></field>

<field name='SURNAME'></field>

<field name='INIT'></field>

<field name='SUBBUILD'></field>

<field name='BUILDNAME'></field>

<field name='DOORNO'></field>

<field name='STREET'></field>

<field name='VILLAGE'></field>

<field name='TOWN'></field>

<field name='COUNTY'></field>

<field name='POSTCODE'></field>

<field name='TELEPHONE'></field>

</recordset>

</var>

</struct>

</data>

</wddxPacket>



The vartype of ER, BU or BT are the three different types of data I can get, I will only be using ER as specified in the TYPE variable in my request.

I have no clue how to do any of this.

Do you have any example files of

(a) how to build the request and send it to the URL in PHP

(b) how to capture the response in this format and display it on the screen (again in PHP on the server side so the user can't access the data or figure out how to run his own requests. The data will be names, addresses and phone numbers with these fields as listed in that specification above:

<field name='FORENAME'></field>

<field name='SURNAME'></field>

<field name='INIT'></field>

<field name='SUBBUILD'></field>

<field name='BUILDNAME'></field>

<field name='DOORNO'></field>

<field name='STREET'></field>

<field name='VILLAGE'></field>

<field name='TOWN'></field>

<field name='COUNTY'></field>

<field name='POSTCODE'></field>

<field name='TELEPHONE'></field>





Any pointers would be MUCH appreciated



Paul
 
Back
Top