[Last Call] Learn how to a build a cloud-first strategyRegister Now


How can i use PHP to submit a SOAP request

Posted on 2007-09-30
Medium Priority
Last Modified: 2013-11-18
I am trying to setup a donation fom that submits into an API. What i need to know, is how to do this using PHP and SOAP.

This is an example SOAP request for the API I am using

POST /services/Sphere.asmx HTTP/1.1
Host: www.kintera.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://www.kintera.com/services/MakeSupporterDonation"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <KinteraSoapHeader xmlns="https://www.kintera.com/services/">
    <MakeSupporterDonation xmlns="https://www.kintera.com/services/">
        <PaymentType>CreditCard or OnlineCheck</PaymentType>
Question by:edgardoburgos

Accepted Solution

theevilworm earned 1000 total points
ID: 19988439
You should use already existing soap client implementations.
php5 has a native soap implementation: http://php.net/soap
nusoap: http://sourceforge.net/projects/nusoap/
pear soap: http://pear.php.net/package/soap/

there are a lot of php soap tutorials when searching google for any implementation you choose and it's likely you'll find one that fits your programming style:

I would suggest you use nusoap if your application needs to run on both php4 and php5 or the native php5 soap extension if only php5 will be used.

If the service you are building a client for provides a WSDL document, it's extremly easy to write a client for it. Any php soap implementation can generate an object from the WSDL and you're left with only implementing the functionality into your already existing script.
LVL 23

Assisted Solution

rama_krishna580 earned 1000 total points
ID: 20068839

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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 how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month18 days, 8 hours left to enroll

825 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