Solved

Web Services; Sending POST Data

Posted on 2007-11-14
4
1,144 Views
Last Modified: 2012-06-21
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.
<?php
$webServicePath = "http://web.service.url/path.php";
$parameters = "...";
 
$result = simplexml_load_file($webServicePath);
?>

Open in new window

0
Comment
Question by:lexxwern
  • 2
4 Comments
 
LVL 12

Author Comment

by:lexxwern
ID: 20287248
Also which Php-Ajax library/class would you recommend. Am lookign for some really simple and intuitive.

Thanks,
0
 
LVL 48

Expert Comment

by:hernst42
ID: 20287361
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
0
 
LVL 21

Accepted Solution

by:
nizsmo earned 500 total points
ID: 20287701
You can also send post data without CURL if you don't have the extension:
http://netevil.org/blog/2006/nov/http-post-from-php-without-curl

also a good tutorial about how to use curl to send post-data:
http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html

Hope this helps.
0
 
LVL 12

Author Closing Comment

by:lexxwern
ID: 31409287
Great stuff, thanks.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question