Web Services; Sending POST Data

I have an external web service. I use SimpleXML to read the results of that service. The web service docs tell me that I have to pass parameters as POST variables. How do I do that?

(Php Code Attached)

How can I send $parameters to the web service via POST to get the right result.
$webServicePath = "http://web.service.url/path.php";
$parameters = "...";
$result = simplexml_load_file($webServicePath);

Open in new window

LVL 12
Who is Participating?
nizsmoConnect With a Mentor DeveloperCommented:
You can also send post data without CURL if you don't have the extension:

also a good tutorial about how to use curl to send post-data:

Hope this helps.
lexxwernAuthor Commented:
Also which Php-Ajax library/class would you recommend. Am lookign for some really simple and intuitive.

I recommend http://www.xajaxproject.org. Easy simple to use from php and has all you need.

To send post data you need to use curl to fetch the result and then use simplexml_load_string()
See http://www.php.net/curl
lexxwernAuthor Commented:
Great stuff, thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.