We have a local database of our products without the price. To get the price, we need to POST an XML file containing the product ID and the credential of our company to the manufacturer. The manufacturer will send back the same XML file and will add the price in a new tag. I need to parse that file to get the price.
Here is a part of the manufacturer specification :
The client must first build a Request XML document (see specific examples below).
Once the XML document has been built the client software must initiate an HTTPS connection with the server. The client must present its client certificate as part of this process in order to authenticate itself with the server. If client certificate authentication is not possible then the UserID and Password fields in the XML must be populated with a valid UserID/password combination on the server.
After the HTTPS session has been established the client must POST the XML document to the server.
The server will process the document and return any information that it is able to provide. It is important to note that the server will not build a new document, but will add information to the request document. The client must then parse this XML document to extract the required information.
I was thinking of using AJAX to do that. But after a couple of minutes i figured out that I couldn't do that for the following reason :
- It impossible to use cross-side AJAX
- I can't create an XML file in JavaScript
- The credential will be in clear text in the XML file
I don't think I can do that with PHP either (server side).
Are my last option a Java Applet or Flash ActionScript ? How would you do that ?