Solved

Web Services; Sending POST Data

Posted on 2007-11-14
4
1,143 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
can windows 10 wamp send mail()? 3 32
Angular - "nest" service calls? 18 22
datetime in sql 6 25
Problem sending file attachments 8 23
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now