Link to home
Start Free TrialLog in
Avatar of bleggee
bleggeeFlag for United States of America

asked on

How to add XML to a Web Page

Hi - I was looking for a tutorial or a "How To" in order to learn how add 1 small XML call to a web page of ours. It is 2-lines of  XML code (our Key and a part number) and the XML returned is simply a "Quantity in Stock" that we want to display on our web page)
Although we are XML Dummies, we have done PHP coding with MySQL, Web development, have done Web Reply Forms, etc. and do command-level Linux. So we are thinking "How hard could XML be?"  If it matters, we are doing this on Linux/LAMP Servers, NOT Microsoft/IIS.

Before we start digging around Googling & Reading books, I thought someone might point us in the right direction ...

Thanks all !
- B
Avatar of kaufmed
kaufmed
Flag of United States of America image

XML is not executable code--it is markup language. When you say "add 1 small XML call" do you mean that you want to call a web service?
Avatar of bleggee

ASKER

Hi Kaufmed - Specifically, I want to get a part's current "Quantity in Stock" printed on my web page ... per my Vendors XML, which looks like this:
===============================================================
*** REST Quantity Check ***
To use the REST option, you will need to access the ‘quantitycheck script by sending XML to
https://www.eldoradopartner.com/quantitycheck/

The XML sent will need to use the POST method via port 443 (the default port for https). The
product, the product identifier (‘products_model’) and the stock needed should be provided in an XML block like this:
<item></item>
For example, to find out if there is enough stock to order 3 units of a product with the
‘products_model’ 1234AB, and your store key is 1a2aa3456aaaa789a0a123456a7a890a, you
would need to send the following XML:

<key>1a2aa3456aaaa789a0a123456a7a890a</key>
<item>123AB</item>
To the following url https://eldoradopartner.com/quantitycheck/

The following XML will be returned:

<quantity>
<item>123AB</item>
<amount>41</amount>
</quantity>

If the item is out of stock, a quantity of 0 will be returned:

<quantity>
<item>123AB</item>
<amount>0</amount>
</quantity>

*** SOAP Quantity Check ***
If you are familiar with SOAP and would like to use this protocol to check quantity, simply go to
the following url:
https://www.eldoradopartner.com/quantitycheck/wsQuantityCheck.php
Click on WSDL link to view WSDL (web service description) for the service.
===============================================================
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
here is a link to the simpleXML link
(note that you need to explicitely enable it for older PHP)
http://www.php.net/manual/en/simplexml.examples-basic.php
for getting access to the REST service, you can use the http client library
http://www.php.net/manual/en/book.http.php
but you need to explicitely add it to your install
and you are right... as the simpleXML samples tell you: "how hard can XML be?"
the XML is the easy part in this project.
Pulling it off the REST service is the hard(er) coding part
Avatar of bleggee

ASKER

THANKS GERTONE !!
Um..thanks. I guess my period did the trick eh? :)
Welcome, but uhm, did you not accept the wrong answer? :-)
Avatar of bleggee

ASKER

Moderator ... let me take a stab at awarding points again ... thx everyone for being on top if this.
MicroPC1 - Yes, that "period" was impressive, I tried & tried using it, but I think I'll have to go with one of the other answers this time :-)
Yeah np,  i actually did post something substantial at first, but after reading your post again I decided to remove it. Unfortunately there's no way to delete a post (as far as I can tell), so I just stuck a period in there.