How can i use PHP to submit a SOAP request

Posted on 2007-09-30
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
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: ""

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
    <KinteraSoapHeader xmlns="">
    <MakeSupporterDonation xmlns="">
        <PaymentType>CreditCard or OnlineCheck</PaymentType>
Question by:edgardoburgos
    LVL 3

    Accepted Solution

    You should use already existing soap client implementations.
    php5 has a native soap implementation:
    pear 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


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    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 …

    745 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

    18 Experts available now in Live!

    Get 1:1 Help Now