Jump to content

Soap request example to code


asmith

Recommended Posts

Hello,

 

This is supposed to be a sample soap request. I don't know how to actually send the request with php.

 

POST /sendSms.asmx HTTP/1.1
Host: host_site.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://some_uri.com/sendSms"

<?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>
    <sendSms xmlns="http://some_uri.com/">
      <username>string</username>
      <password>string</password>
      <smsContent>
        <string>string</string>
        <string>string</string>
      </smsContent>
      <cell>
        <string>string</string>
        <string>string</string>
      </cell>
      <from>string</from>
    </sendSms>
  </soap:Body>
</soap:Envelope>

 

How am I supposed to so send this info? What is soapAction there?

 

I tried:

 

$client = new SoapClient("host_site.com/sendSms.asmx");

 

and I'm getting:

 

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'host_site.com/sendSms.asmx' : Premature end of data in tag html line 3 in ...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.