Fatal error: Uncaught SoapFault exception: [Client] Function ("AuthenticationHeader") is not a valid method for this service in D:\xampp\htdocs\soap\index_2.php:132 Stack trace: #0 D:\xampp\htdocs\soap\index_2.php(132): SoapClient->__call('AuthenticationH...', Array) #1 D:\xampp\htdocs\soap\index_2.php(132): SoapClient->AuthenticationHeader(Array) #2 {main} thrown in D:\xampp\htdocs\soap\index_2.php on line 132
0
votes
Some Code would be nice to see, so we can help you better.
– Rizier123
1 Answers
0
votes
There are must be only one request, you send three. You must create something like this:
1) Set header for authentication:
$auth = $auth = new SOAPAuth('USERNAME', 'PASSWORD');
$header = new SOAPHeader('urn:example.org/auth', 'AuthenticationHeader', $auth);
$client->__setSoapHeaders($header);
2) Create create request with message text and contacts.
$result = $client->SendSMSToContacts(array("MessageText" => "some text", "contactIDs" => array(123456789, 123456789));
P.S. For the debugging create client with:
$client = new SoapClient($url, array('trace' => 1,
'exceptions' => 1,));
and after sending request, look on request that was sended and resopnse on it:
var_dump("REQUEST=", $client->__getLastRequest());
var_dump("RESPONSE=", $client->__getLastResponse());
if you look at the error code you will see AuthenticationHeader is not a method! the error is very clear!
use this
or download soap ui. (google it!)
and you will see what method are available!