/    Sign up×
Community /Pin to ProfileBookmark

Php -> Xml -> Wddx

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,POSTTOWN,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,TELEPHONE’>

<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

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@JickJul 19.2003 — [B]Warning: You also posted in the XML Forum. This is known as cross-posting and is not allowed at the Web Developer Forums.[/B]
×

Success!

Help @pmf123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...