Solved

Web Services; Sending POST Data

Posted on 2007-11-14
4
1,148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

734 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