Last active
August 29, 2015 14:18
-
-
Save abrahamfast/1c6bf065fd2b54e57028 to your computer and use it in GitHub Desktop.
Send Sms for http://smartsms.ir/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('cytco/library/nusoap/nusoap.php'); | |
$url="http://212.16.76.90/ws/sms.asmx?WSDL"; | |
$client = new nusoap_client($url, 'wsdl'); | |
$client->soap_defencoding = 'UTF-8'; | |
$client->decode_utf8 = true; | |
$param=array( | |
'requestData' => | |
'<xmsrequest> | |
<userid>secret</userid> | |
<password>secret</password> | |
<action>smssend</action> | |
<body> | |
<type>oto</type> | |
<recipient mobile="9305476531">Hi Dear :)</recipient> | |
</body> | |
</xmsrequest>'); | |
$result = $client->call('XmsRequest', $param); | |
echo $result["XmsRequestResult"]; | |
if ($client->fault) { | |
echo '<h2>Fault</h2><pre>'; | |
print_r($result); | |
echo '</pre>'; | |
} else { | |
// Check for errors | |
$err = $client->getError(); | |
if ($err) { | |
// Display the error | |
echo '<h2>Error</h2><pre>' . $err . '</pre>'; | |
} else { | |
// Display the result | |
echo '<h2>Result</h2><pre>'; | |
print_r($result); | |
echo '</pre>'; | |
} | |
} | |
die(); | |
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>'; | |
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>'; | |
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>'; | |
echo "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment