LyleHolmes
asked on
How do I send HTTPS POST to web service using XML and PHP?
We have to send a request to a web service using HTTPS POST. The code below is the XML that we will send. It sends a UPC number that comes from our MySQL database on an Apache server. The web service then responds with the product details associated with the UPC number. We send the POST to:
https://Secure.Website.Com/Webservices/upc.Exe/onlinestore
We are planning to use PHP to create and process the POST. We're trying to keep it simple.
Is this correct? We create a simple html form that pulls the UPC from our database (no problem there). Our html form uses a php script that we create for the action in the form. This PHP script assembles the XML request and passes it via HTTPS POST to the web service.
Assuming this is essentially correct, we are looking for any samples of the PHP script necessary to assemble the data and process the POST.
Thanks a bunch.
https://Secure.Website.Com/Webservices/upc.Exe/onlinestore
We are planning to use PHP to create and process the POST. We're trying to keep it simple.
Is this correct? We create a simple html form that pulls the UPC from our database (no problem there). Our html form uses a php script that we create for the action in the form. This PHP script assembles the XML request and passes it via HTTPS POST to the web service.
Assuming this is essentially correct, we are looking for any samples of the PHP script necessary to assemble the data and process the POST.
Thanks a bunch.
<TRANSACTION>
<RNCERT>BDF95</RNCERT>
<TRANSACTIONTYPE>GETUPCINVENTORY</TRANSACTIONTYPE>
<UPC>883929015368</UPC>
<SHOWITEMDETAILS>TRUE</SHOWITEMDETAILS>
</TRANSACTION>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Matthias,
I assume the php/echo is on the page with "https://webservice" being replaced by the actual URL that we are going to post to.
Do we define the fields being delivered within the CURL using variables?
I assume the php/echo is on the page with "https://webservice" being replaced by the actual URL that we are going to post to.
Do we define the fields being delivered within the CURL using variables?
ASKER
Hey Matthias,
Your code worked very well.
Thanks for the input.
Lyle
Your code worked very well.
Thanks for the input.
Lyle
Kind regards,
Matthias Vance
Open in new window