Source for file soapclient.php
Documentation is available at soapclient.php
* Copyright (c) 2010, ComVision
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* - Neither the name of the smsAPI.pl nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @author ComVision <info@smsapi.pl>
* @copyright 2010 ComVision
* @subpackage client\soap
* @version 1.0 14.10.2010
* Client smsAPI przez SOAP
* require_once 'smsapi.php';
* spl_autoload_register(array('smsAPI','__autoload'));
* $smsapi = new smsAPI_SOAPClient('login', md5('password') );
* $msg = $smsapi->new_sms_multi();
* $msg->recipient = array('xxxxxxxxx','yyyyyyyyy');
* $msg->message = 'test';
* $result = $msg->send();
* @see https://www.smsapi.pl/webservices/v2/?wsdl
* @param bool $ssl SOAP przez http lub https
public function __construct($username, $password, $ssl =
true)
$this->h_sopa =
new SoapClient(
( $ssl ==
true ?
'https' :
'http' ) .
'://www.smsapi.pl/soap/v2/webservice?wsdl',
'features' =>
SOAP_SINGLE_ELEMENT_ARRAYS,
'cache_wsdl' =>
WSDL_CACHE_NONE
* Wysylanie pojedynczej wiadomosci
* @param smsAPI_SOAP_SMS $sms
* @return smsAPI_SOAP_Response_SMS
'sms' =>
$sms->_get_params()
if( !isset
($response->response) ) $response->response =
array();
* @return smsAPI_SOAP_SMS
public function new_sms($params =
null)
* Wysylanie wiadomosci masowych
* @param smsAPI_SOAP_SMSMulti $sms
* @return smsAPI_SOAP_Response_SMS
'sms' =>
$sms->_get_params()
$response =
$this->___soapCall('send_sms_multi', $request);
if( !isset
($response->response) ) $response->response =
array();
* @return smsAPI_SOAP_SMSMulti
* Sprawdzanie raportow doreczenia wiadomosci po wskazaniu ich ID
* @return smsAPI_SOAP_Response_SMSStatus
$response =
$this->___soapCall('get_sms_by_ids', $request);
* Sprawdzanie raportow doreczenia wiadomosci wyslanych w okreslonym przedziale czasowym
* @return smsAPI_SOAP_Response_SMSStatus
$response =
$this->___soapCall('get_sms_by_date', $request);
if( !isset
($response->status) ) $response->status =
array();
* Usuwanie wiadomosci zaplanowanych
* @return smsAPI_SOAP_Response
if( !isset
($id) OR empty($id) )
$response =
$this->___soapCall('delete_sms_by_id', $request);
if( !isset
($response->status) ) $response->status =
array();
* Dodawanie grupy do ksiazki telefonicznej
* @param string $name Nazwa grupy
* @param string $info Opis grupy
* @return smsAPI_SOAP_Response_AddGroup
if( !isset
($name) OR empty($name) )
* Pobiera grupy z ksiazki telefonicznej uzytkownika
* @return smsAPI_SOAP_Response_GetGroups
* Usuwa grupe z ksiazki telefonicznej
* @param int $group_id ID grupy w ksiazce telefonicznej
* @return smsAPI_SOAP_Response
'group_id' => (int)
$group_id
$response =
$this->___soapCall('delete_group', $request);
* Dodaje numer do ksiazki telefonicznej
* @param string $number Nazwa grupy
* @param string $name Nazwa w ksiazce telefonicznej
* @param int $group_id Numer grupy uzytkownik'ow w ksiazce telefonicznej
* @return smsAPI_SOAP_Response
public function add_number($number, $name, $group_id)
if( !isset
($name) OR empty($name) )
'number' => (string)
$number,
'group_id' => (int)
$group_id
$response =
$this->___soapCall('add_number', $request);
* Pobieranie numer'ow z ksiazki telefonicznej uzytkownika
* @param int $group_id ID grupy w ksiazce telefonicznej
* @return smsAPI_SOAP_Response_GetNumbers
'group_id' => (int)
$group_id
$response =
$this->___soapCall('get_numbers', $request);
if( !isset
($response->numbers) ) $response->numbers =
array();
* Usuwanie numeru z ksiazki telefonicznej
* @param string $number Numer telefonu
* @param int $group_id ID grupy w ksiazce telefonicznej
* @return smsAPI_SOAP_Response
'number' => (string)
$number,
'group_id' => (int)
$group_id
$response =
$this->___soapCall('delete_number', $request);
* Sprawdzanie ilosci punktow na koncie.
* @return smsAPI_SOAP_Response_GetPoints
* Pobieranie dostepnych pol nadawcy
* @return smsAPI_SOAP_Response_GetSenders
* @param string $function
protected function ___soapCall($function, $request =
array())
smsAPI::call_listners(__CLASS__.
' '.
$function.
' request', $request);
$response =
$this->h_sopa->$function( $request );
smsAPI::call_listners(__CLASS__.
' '.
$function.
' response', $response);
* Pobierz uchwyt do SoapClient
Documentation generated on Thu, 27 Jan 2011 16:17:36 +0100 by phpDocumentor 1.4.3