• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

SOAP and PHP. What the...???

bozley05

NLC
NLC
Okay, I'm trying to work out how to use an API.. Below is the SOAP example to check a Mobile number. How do I make it do that request in PHP?

Code:
POST /api/webservice.asmx HTTP/1.1
Host: www.smsbug.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.smsbug.com/api/coverage"

<?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:Body>
    <coverage xmlns="http://www.smsbug.com/api/">
      <Mobile_Number>[B]string[/B]</Mobile_Number>
    </coverage>
  </soap:Body>
</soap:Envelope>

And apparently, it gives a result like this:

Code:
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:Body>
    <coverageResponse xmlns="http://www.smsbug.com/api/">
      <coverageResult>[B]string[/B]</coverageResult>
    </coverageResponse>
  </soap:Body>
</soap:Envelope>

Once it returns the result, how do I make it so I can use it as a PHP variable?

I hope someone knows what I am on about.
 
Back
Top