public marks

PUBLIC MARKS from imelgrat with tags "Sample Code" & web

17 July 2007 16:30

Sending XML files to a Webservice (Using cURL)

a PHP function that hides all the necessary logic from the user and handles the posting of the XML document and returns whatever the server responds. It relies on PHP’s cURL library (so you need it properly configured on your server in order to work). All you need to do is create the XML document, choose the URL (and port) to which you want to post the XML document and the function takes care of the rest. Below is the function code. As you can see, the function can handle SSL-enabled servers, something that provides a great advantage, since many Web services run on HTTPS.