PHP - SOAP 1.1 request and response handling in php

Hi All,

I am trying to integrate netForum with my PHP project. It needs some SOAP requests. The following is a sample SOAP 1.1 request and response, but i don’t know how to implement this in php? Please any one show me an example? Please anyone help me!!!

Request -

POST /xweb/netFORUMXMLONDemand.asmx HTTP/1.1
Host: nftpsandbox.avectra.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.avectra.com/OnDemand/2005/NewIndividualInformation"

<?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/">
  <soap:Header>
    <AuthorizationToken xmlns="http://www.avectra.com/OnDemand/2005/">
      <Token>string</Token>
    </AuthorizationToken>
  </soap:Header>
  <soap:Body>
    <NewIndividualInformation xmlns="http://www.avectra.com/OnDemand/2005/">
      <oNode>xml</oNode>
    </NewIndividualInformation>
  </soap:Body>
</soap:Envelope>

Response -

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?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/">
  <soap:Header>
    <AuthorizationToken xmlns="http://www.avectra.com/OnDemand/2005/">
      <Token>string</Token>
    </AuthorizationToken>
  </soap:Header>
  <soap:Body>
    <NewIndividualInformationResponse xmlns="http://www.avectra.com/OnDemand/2005/">
      <NewIndividualInformationResult>xml</NewIndividualInformationResult>
    </NewIndividualInformationResponse>
  </soap:Body>
</soap:Envelope>

Welcome to Sitepoint. :slight_smile:

You will need to use this WSDL and PHP’s [URL=“http://www.php.net/manual/en/class.soapclient.php”]SOAP Client.

There’s plenty of information to get you on your way in the manual. :wink: