SoapClient PHP Class Code Examples

This page contains top rated real world PHP examples of class SoapClient extracted from open source projects. You can rate examples to help us improve the quality of examples

Example #1
Show file File: InviteController.php Project: Yatko/Gifteng
0
 /**
  * Invokes the user registration on WS.
  *
  * @return response
  * @throws Exception in case of WS error
  */
 public function registerUser()
 {
     try {
         $userService = new SoapClient(Config::get('wsdl.user'));
         $user = new UserModel(Input::all());
         $array = array("user" => $user, "password" => Input::get('password'), "invitationCode" => Input::get('code'));
         if (Input::get('ref')) {
             $array['referrerId'] = Input::get('ref');
         }
         $result = $userService->registerUser($array);
         $authService = new SoapClient(Config::get('wsdl.auth'));
         $token = $authService->authenticateEmail(array("email" => Input::get('email'), "password" => Input::get('password'), "userAgent" => NULL));
         ini_set('soap.wsdl_cache_enabled', '0');
         ini_set('user_agent', "PHP-SOAP/" . PHP_VERSION . "\r\n" . "AuthToken: " . $token->AuthToken);
         Session::put('user.token', $token);
         try {
             $userService = new SoapClient(Config::get('wsdl.user'));
             $result = $userService->getUserByEmail(array("email" => Input::get('email')));
             $user = $result->user;
             /*	if ($user -> businessAccount == true) {
             				if (isset($user -> addresses) && is_object($user -> addresses)) {
             					$user -> addresses = array($user -> addresses);
             				}
             			}  */
             Session::put('user.data', $user);
             return array('success' => true);
         } catch (InnerException $ex) {
             //throw new Exception($ex -> faultstring);
             return array('success' => false, 'faultstring' => $ex->faultstring);
         }
     } catch (Exception $ex) {
         return array('success' => false, 'faultstring' => $ex->faultstring);
     }
 }
Example #2
Show file File: CKY_Product.php Project: ohjack/mallerp_standard
0
 public function get_product_list($data)
 {
     $getProductList = new GetProductList();
     $getProductList->pageIndex = $data['page_index'];
     $getProductList->pageSize = $data['page_size'];
     $getProductList->key = $this->key;
     echo '<pre>';
     echo '<meta content="text/html; charset=utf-8" http-equiv="Content-Type">';
     try {
         $client = new SoapClient($this->product_gateway_url);
         $response = $client->GetProductList($getProductList);
         var_dump($response);
         //            $result = $response->GetStockResult;
         //            if ($result->Success)
         //            {
         //                return array(
         //                    'title' => $result->Result->Title,
         //                    'storage_no' => $result->Result->StorageNo,
         //                    'amount' => $result->Result->Amount,
         //                    'amount_out' => $result->Result->AmountOut,
         //                    'weight' => $result->Result->Weight,
         //                    'packing' => $result->Result->Packing,
         //                );
         //            }
         //            else
         //            {
         //                return array('status' => FALSE, 'message' => $result->Message);
         //            }
     } catch (SOAPFault $exception) {
         return FALSE;
     }
 }
Example #3
Show file File: SoapSapController.php Project: afouladvand/showcasegcweb
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function callWebserviceRead($parameters)
 {
     ini_set('default_socket_timeout', '30');
     $sap_host = '192.168.10.21';
     //gbserv10erp
     $sap_port = '8000';
     $sap_client = '200';
     $sap_user = 'RFC_TEST';
     $sap_pass = 'rfcrfc123';
     $function = 'Z_GOBIZ_HAU_WSR_PARTNER';
     $wsdl = 'http://' . $sap_host . ':' . $sap_port . '/sap/bc/soap/wsdl?services=' . $function;
     try {
         $time_start = microtime(true);
         $SoapClient = new SoapClient($wsdl, array('login' => $sap_user, 'password' => $sap_pass, 'location' => 'http://' . $sap_host . ':' . $sap_port . '/sap/bc/soap/rfc?sap-client=' . $sap_client, 'uri' => $wsdl));
         $result = array();
         $result = $SoapClient->{$function}($parameters);
         $time_request = microtime(true) - $time_start;
     } catch (SoapFault $soapFault) {
         //$log = fopen(DIR_SOAPLOG . LOG_SOAPLOG,'a');
         //fwrite($log, $soapFault);
         //fclose($log);
     }
     //return $result;
     //
 }
Example #4
Show file File: functions.inc.php Project: BGCX067/eyetv-epg-proxy-svn-to-git
0
function getEPGData($providerId)
{
    global $baseTime, $daysRequested, $config;
    $cacheFile = "./cache/{$providerId}.cache";
    chdir($config['localDir']);
    if (!isExpired($cacheFile)) {
        $fp = fopen($cacheFile, 'r') or die("Can't open provider cache file for reading.");
        $serializedResponse = "";
        while (!feof($fp)) {
            $serializedResponse .= fread($fp, 8192);
        }
        fclose($fp);
        $response = unserialize($serializedResponse);
        return $response;
    }
    $username = $config['sd_access'][$providerId]['username'];
    $password = $config['sd_access'][$providerId]['password'];
    $client = new SoapClient("http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl", array('login' => $username, 'password' => $password, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_DEFLATE));
    if (!isset($daysRequested)) {
        $daysRequested = 8;
    }
    if (isset($config['numDaysEPG'])) {
        $daysRequested = $config['numDaysEPG'];
    }
    if (isset($config['providers'][$providerId]['numDaysEPG'])) {
        $daysRequested = $config['providers'][$providerId]['numDaysEPG'];
    }
    $startTime = gmstrftime("%Y-%m-%dT00:00:00Z", $baseTime);
    $endTime = gmstrftime("%Y-%m-%dT00:00:00Z", strtotime("+{$daysRequested} days", time()));
    $response = $client->download($startTime, $endTime);
    $fp = fopen("./cache/" . $providerId . '.cache', 'w') or die("Can't open provider cache file for writing.");
    fwrite($fp, serialize($response));
    fclose($fp);
    return $response;
}
Example #5
Show file File: alphaclick.php Project: Nikitian/fl-ru-damp
0
 public function checkCustomer2($name)
 {
     $client = new SoapClient(null, array('location' => 'http://testssl.alfabank.ru/CS/EQ/WSCustomerAlfaClick/WSCustomerAlfaClick10', "uri" => "http://WSCustomerAlfaClick10.EQ.CS.ws.alfabank.ru", "style" => SOAP_RPC, "use" => SOAP_LITERAL, 'trace' => 1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE, 'soap_version' => SOAP_1_1));
     //$soap->WSCustomerAlfaClick10($name);
     $ID_client = new SoapVar("2694835", XSD_STRING);
     //array("ID_client", "2694835");
     //$inParms = array(new SoapParam($ID_client, "ID_client"));
     $wrapper->ID_client = $ID_client;
     $inParms = new SoapParam($wrapper, "inParms");
     $arr = array('inParms' => $ID_client);
     $externalSystemCode = new SoapVar("GRCHK14", XSD_STRING);
     $externalUserCode = new SoapVar("GRCHK14", XSD_STRING);
     $wrapper2->externalSystemCode = $externalSystemCode;
     $wrapper2->externalUserCode = $externalUserCode;
     $inCommonParms = new SoapParam($wrapper2, "inCommonParms");
     //$inParms = array($inParms, "inParms");
     //var_dump($soap->WSCustomerAlfaClickCheck(new SoapParam($ID_client, 'ID_client')));
     try {
         var_dump($client->__soapCall('WSCustomerAlfaClickCheck', array($inCommonParms, $inParms)));
         //$soap->WSCustomerAlfaClickCheck($inParms);
     } catch (SoapFault $ex) {
         echo 'Request : <br/><xmp>', $ex->__getLastRequest(), '</xmp><br/><br/> Error Message : <br/>', $ex->getMessage();
         //var_dump($ex->faultcode, $ex->faultstring, $ex->faultactor, $ex->detail, $ex->_name, $ex->headerfault);
         //echo $ex->detail->WSAppException->errorCode . "<br />";
         //cho iconv('UTF-8', 'CP1251', $ex->detail->WSAppException->errorString . "<br />");
     }
     //echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
 }
Example #6
Show file File: RegisterZavodov.php Project: lidijakralj/bober
0
 public static function GetRegZavod()
 {
     $debug = false;
     $wsdl_url = dirname(__FILE__) . '/RegZavodServicePort.wsdl';
     if (!file_exists($wsdl_url)) {
         echo 'Missing WSDL shema for RegZavodServicePort.wsdl', "\n";
         echo 'WSDL PATH: ', $wsdl_url, "\n";
         die;
     }
     $client = new SoapClient($wsdl_url, array('exceptions' => 0, 'trace' => 1, 'user_agent' => 'Bober'));
     $result = $client->__soapCall('getRegZavod', array());
     if ($debug) {
         var_dump($client->__getFunctions());
         echo 'REQUEST HEADERS:', "\n", $client->__getLastRequestHeaders(), "\n";
         echo 'REQUEST:', "\n", $client->__getLastRequest(), "\n";
         var_dump($result);
         if (is_soap_fault($result)) {
             trigger_error('SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})', E_USER_ERROR);
         }
         print_r($result);
     }
     if ($result != '' && !is_soap_fault($result)) {
         $result = json_decode(json_encode($result), true);
         return $result;
     } else {
         return array();
     }
 }
Example #7
Show file File: oxonlinevatidcheck.php Project: ioanok/symfoxid
0
 /**
  * Checks online if USt.ID number is valid.
  * Returns true on success. On error sets error value.
  *
  * @param object $oCheckVat vat object
  *
  * @return bool
  */
 protected function _checkOnline($oCheckVat)
 {
     if ($this->_isServiceAvailable()) {
         $iTryMoreCnt = self::BUSY_RETRY_CNT;
         //T2009-07-02
         //how long socket should wait for server RESPONSE
         ini_set('default_socket_timeout', 5);
         // setting local error handler to catch possible soap errors
         set_error_handler(array($this, 'catchWarning'), E_WARNING);
         do {
             try {
                 //connection_timeout = how long we should wait to CONNECT to wsdl server
                 $oSoapClient = new SoapClient($this->getWsdlUrl(), array("connection_timeout" => 5));
                 $this->setError('');
                 $oRes = $oSoapClient->checkVat($oCheckVat);
                 $iTryMoreCnt = 0;
             } catch (SoapFault $e) {
                 $this->setError($e->faultstring);
                 if ($this->getError() == "SERVER_BUSY") {
                     usleep(self::BUSY_RETRY_WAITUSEC);
                 } else {
                     $iTryMoreCnt = 0;
                 }
             }
         } while (0 < $iTryMoreCnt--);
         // restoring previous error handler
         restore_error_handler();
         return (bool) $oRes->valid;
     } else {
         $this->setError("SERVICE_UNREACHABLE");
         return false;
     }
 }
Example #8
Show file File: webservice_sat.php Project: njmube/CSDOCSCFDI
0
 public function valida_cfdi($rfc_emisor, $rfc_receptor, $total_factura, $uuid)
 {
     /*
             * Mensajes de Respuesta
             Los mensajes de respuesta que arroja el servicio de consulta de CFDI´s incluyen la descripción del resultado de la operación que corresponden a la siguiente clasificación:
             Mensajes de Rechazo.
             N 601: La expresión impresa proporcionada no es válida.
             Este código de respuesta se presentará cuando la petición de validación no se haya respetado en el formato definido.
             N 602: Comprobante no encontrado.
             Este código de respuesta se presentará cuando el UUID del comprobante no se encuentre en la Base de Datos del SAT.
             Mensajes de Aceptación.
             S Comprobante obtenido satisfactoriamente.
     */
     //           printf("\n clase webservice rfce=$rfc_emisor rfcr=$rfc_receptor total=$total_factura uuid=$uuid");
     $web_service = "https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl";
     try {
         $hora_envio = date("Y-m-d H:i:s");
         $client = new SoapClient($web_service);
     } catch (Exception $e) {
         echo 'Excepción capturada: ', $e->getMessage(), "\n";
     }
     $cadena = "re={$rfc_emisor}&rr={$rfc_receptor}&tt={$total_factura}&id={$uuid}";
     $param = array('expresionImpresa' => $cadena);
     $respuesta = $client->Consulta($param);
     $hora_recepcion = date("Y-m-d H:i:s");
     $xml = 0;
     if ($respuesta->ConsultaResult->Estado == 'Vigente') {
         $cadena_encriptar = $hora_envio . '│' . $rfc_emisor . '│' . $rfc_receptor . '│' . $total_factura . '│' . $uuid . '│' . $hora_recepcion;
         $md5 = md5($cadena_encriptar);
         $xml = $this->create_xml($respuesta, $rfc_emisor, $rfc_receptor, $total_factura, $uuid, $web_service, $hora_envio, $hora_recepcion, $md5);
     }
     return $xml;
 }
Example #9
Show file File: CommonAction.class.php Project: tmlsoft/main
0
 function SendTelmMsg($content, $telarr)
 {
     if ($content == "") {
         $this->error("不能发送空短信");
     }
     if (is_array($telarr)) {
         $tel = array();
         foreach ($telarr as $k => $v) {
             $tel[] = $v;
         }
         $telnum = implode(",", $tel);
     } else {
         $telnum = $telarr;
     }
     $settingmsginfo = C("SendPhoneMsg");
     $CorpID = $settingmsginfo['CorpID'];
     $Pwd = $settingmsginfo['Pwd'];
     //判断操作系统
     // 		$agent=$_SERVER["HTTP_USER_AGENT"];
     // 		if(eregi("win",$agent)){
     // 			import ( '@.ORG.Snoopy' );
     // 			$snoopy=new Snoopy();
     // 			$content= iconv("UTF-8","GB2312",$content);
     // 			$aryPara = array('CorpID' => $CorpID, 'Pwd'=> $Pwd, 'Mobile'=> $telnum, 'Content'=> $content,'Cell'=>'','SendTime'=>'');
     // 			$snoopy->submit("http://www.ht3g.com/htWS/linkWS.asmx/BatchSend",$aryPara);//$formvars为提交的数组
     // 			return $snoopy->results;
     // 		}else{
     import('@.ORG.TelMsg.nusoap', '', $ext = '.php');
     $client = new SoapClient('http://www.ht3g.com/htWS/linkWS.asmx?WSDL');
     $aryPara = array('CorpID' => $CorpID, 'Pwd' => $Pwd, 'Mobile' => $telnum, 'Content' => $content, 'Cell' => '', 'SendTime' => '');
     $re = $client->__call('BatchSend', array('parameters' => $aryPara));
     return $re->BatchSendResult;
     // 		}
 }
Example #10
Show file File: HookCreateDrupalUser.php Project: omaoibrahim/chamilo-lms
0
 /**
  * Create a Drupal user when the Chamilo user is registered
  * @param HookCreateUserEventInterface $hook The hook
  */
 public function hookCreateUser(HookCreateUserEventInterface $hook)
 {
     $data = $hook->getEventData();
     $drupalDomain = CreateDrupalUser::create()->get('drupal_domain');
     $drupalDomain = rtrim($drupalDomain, '/') . '/';
     if ($data['type'] === HOOK_EVENT_TYPE_POST) {
         $return = $data['return'];
         $originalPassword = $data['originalPassword'];
         $userInfo = api_get_user_info($return);
         $fields = array('name' => $userInfo['username'], 'pass' => $originalPassword, 'mail' => $userInfo['email'], 'status' => 1, 'init' => $userInfo['email']);
         $extraFields = array('firstname' => $userInfo['firstname'], 'lastname' => $userInfo['lastname']);
         $options = array('location' => $drupalDomain . 'sites/all/modules/chamilo/soap.php?wsdl', 'uri' => $drupalDomain);
         $client = new SoapClient(null, $options);
         $drupalUserId = false;
         if (isset($_SESSION['ws_drupal_user_id'])) {
             $drupalUserId = $_SESSION['ws_drupal_user_id'];
             return true;
         }
         if ($drupalUserId === false) {
             $drupalUserId = $client->addUser($fields, $extraFields);
         }
         if ($drupalUserId !== false) {
             UserManager::update_extra_field_value($return, 'drupal_user_id', $drupalUserId);
         }
     }
 }
Example #11
Show file File: client_round2_interop.php Project: cefalo19/php-src
0
 /**
  *  fetchEndpoints
  * retrieve endpoints interop server
  *
  * @return boolean result
  * @access private
  */
 function fetchEndpoints($test = NULL)
 {
     // fetch from the interop server
     try {
         $soapclient = new SoapClient($this->interopServer);
         if ($test) {
             $this->_fetchEndpoints($soapclient, $test);
         } else {
             foreach ($this->tests as $test) {
                 $this->_fetchEndpoints($soapclient, $test);
             }
             $test = 'base';
         }
     } catch (SoapFault $fault) {
         if ($this->html) {
             echo "<pre>{$fault}</pre>\n";
         } else {
             echo "{$fault}\n";
         }
         return NULL;
     }
     // retrieve all endpoints now
     $this->currentTest = $test;
     $x = $this->_getEndpoints($test);
     return $x;
 }
Example #12
Show file File: sender.php Project: RodoPF/PagoFacilClient
0
 protected function send_soap()
 {
     $client = new SoapClient($this->wsdl, array('trace' => 1));
     $result = $client->transaccion($this->params);
     print_r($client->__getLastRequest());
     return $result;
 }
Example #13
Show file File: vcb.php Project: quangbt2005/vhost-kis
0
 function CVCB()
 {
     $this->url = VCB_WEBSERVICE_URL;
     $soapClient = new SoapClient(VCB_WEBSERVICE_URL, array('trace' => 1));
     //new SOAP_Client($this->url, true);
     $this->soapClient = $soapClient;
 }
Example #14
Show file File: service_rdwd.class.php Project: h3len/Project
0
 public function detail($id)
 {
     $arr = array();
     $xml = '<?xml version="1.0" encoding="utf-8"?>';
     $xml .= '<paras>';
     $xml .= '<IdentityGuid>Epoint_WebSerivce_**##0601</IdentityGuid>';
     $xml .= '<infoid>' . $id . '</infoid>';
     $xml .= '</paras>';
     $cilentOptions = array('trace' => true, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE);
     $client = new SoapClient(WEB_URL, $cilentOptions);
     $ret_str = $client->SelectBMZX(array('xmlWebInfo' => $xml));
     //var_dump($ret_str);exit();
     $ret_str = $ret_str->SelectBMZXResult;
     $ret_str = xml2Array($ret_str);
     //hg_pre($ret_str);exit();
     if (!$ret_str['DATA']['ReturnInfo']['Status']) {
         return $arr;
     }
     $data = $ret_str['DATA']['UserArea'];
     //hg_pre($data);exit();
     $arr['id'] = $data['infoid'];
     $arr['create_time'] = strtotime($data['infodate']);
     $arr['title'] = $data['title'];
     $arr['content'] = str_replace("&nbsp;", "", strip_tags($data['InfoContent']));
     $arr['click_times'] = $data['ClickTimes'];
     //点击次数
     //hg_pre($arr);exit();
     return $arr;
 }
Example #15
Show file File: class.epaysoap.php Project: digitaldevelopers/woocommerce-1
0
 function __construct($pwd = "", $subscription = false)
 {
     if ($subscription) {
         $client = new SoapClient('https://ssl.ditonlinebetalingssystem.dk/remote/subscription.asmx?WSDL');
     } else {
         $client = new SoapClient('https://ssl.ditonlinebetalingssystem.dk/remote/payment.asmx?WSDL');
     }
     $this->pwd = $pwd;
     $this->client = $client;
 }
Example #16
Show file File: ContactsController.php Project: malamalca/lil-crm
0
 /**
  * admin_inetis method
  *
  * @return void
  */
 public function admin_inetis($ddv)
 {
     $search = array('iskalni_niz' => $ddv);
     $client = new SoapClient('http://ddv.inetis.com/Iskalnik.asmx?WSDL');
     $data = array();
     if (is_callable(array($client, 'Isci')) && ($result = $client->Isci($search))) {
         if (isset($result->IsciResult->anyType)) {
             $result = $result->IsciResult->anyType->enc_value;
             $street = $result->xmlNaslov;
             $zip = '';
             $city = '';
             $post_pos = mb_strrpos($street, ', ');
             if ($post_pos !== false) {
                 $zip = mb_substr($street, $post_pos + 2, 4);
                 $city = mb_substr($street, $post_pos + 6);
                 $street = mb_substr($street, 0, $post_pos);
             }
             $data = array('title' => $result->xmlNaziv, 'mat_no' => $result->xmlMaticnaStevilka, 'tax_no' => $result->xmlDavcnaStevilka, 'tax_status' => $result->xmlPlacnikDDV, 'street' => $street, 'zip' => $zip, 'city' => $city);
         } else {
             return $this->error404();
         }
     }
     $this->RequestHandler->respondAs('json');
     $this->autoRender = false;
     echo json_encode($data);
 }
Example #17
Show file File: Receipt.php Project: njmube/CSDOCSCFDI
0
 public static function ValidateWithWebServiceSAT($rfc_emisor, $rfc_receptor, $total_factura, $uuid)
 {
     $web_service = "https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl";
     $hora_envio = date("Y-m-d H:i:s");
     try {
         $client = new SoapClient($web_service);
     } catch (Exception $e) {
         echo '\\n Error de validación en WS Sat: ', $e->getMessage();
         return 0;
     }
     $cadena = "re={$rfc_emisor}&rr={$rfc_receptor}&tt={$total_factura}&id={$uuid}";
     $param = array('expresionImpresa' => $cadena);
     try {
         $respuesta = $client->Consulta($param);
     } catch (Exception $ex) {
         echo "\n Error en WebService SAT. " . $ex;
         return 0;
     }
     $hora_recepcion = date("Y-m-d H:i:s");
     if ($respuesta->ConsultaResult->Estado == 'Vigente') {
         $cadena_encriptar = $hora_envio . '│' . $rfc_emisor . '│' . $rfc_receptor . '│' . $total_factura . '│' . $uuid . '│' . $hora_recepcion;
         $md5 = md5($cadena_encriptar);
         return $xml = Receipt::CreateReceiptXml($respuesta, $rfc_emisor, $rfc_receptor, $total_factura, $uuid, $web_service, $hora_envio, $hora_recepcion, $md5);
     } else {
         return 0;
     }
 }
Example #18
Show file File: Data.php Project: santhosh400/ecart
0
 public function getServerNotification()
 {
     if (!Mage::getStoreConfig("mcore/upgraded") || Mage::getStoreConfig("mcore/upgraded") != 1) {
         return;
     }
     if ($this->checkDomain($this->getDomain())) {
         try {
             if (class_exists('SoapClient')) {
                 $client = new SoapClient(Mage::getStoreConfig('mcore/activelink'));
                 $session = $client->login(Mage::getStoreConfig('mcore/userapi'), Mage::getStoreConfig('mcore/codeapi'));
                 $idmax = $this->getMaxMessageId();
                 $result = $client->call($session, 'managelicense.getNotification', array(array("idmax" => $idmax)));
                 if (is_array($result) && count($result) > 0) {
                     foreach ($result as $notification) {
                         $noti_inf = Mage::getModel('mcore/notification');
                         $noti_inf->setData($notification);
                         $noti_inf->setStatus(0);
                         $noti_inf->save();
                     }
                 }
             } else {
             }
         } catch (Exception $e) {
         }
     }
 }
Example #19
Show file File: EmsClient.php Project: owenliang/webservice
0
 /**
  * 获取客户端, 会设置一些header
  * @param unknown $clazz
  * @param unknown $method
  * @param unknown $beanId
  * @return SoapClient
  */
 private function getSoapClient($clazz, $method, $beanId, $userId = '')
 {
     $soapClient = new SoapClient(null, array('uri' => SOAP_URI, 'location' => SOAP_LOCATION, 'soap_version' => SOAP_1_2, 'style' => SOAP_RPC, 'trace' => true));
     $header = new SoapHeader(SOAP_NAMESPACE, 'field', (object) array(new SoapVar($beanId, XSD_STRING, null, null, 'beanId', SOAP_NAMESPACE), new SoapVar($clazz, XSD_STRING, null, null, 'clazz', SOAP_NAMESPACE), new SoapVar($method, XSD_STRING, null, null, 'methodName', SOAP_NAMESPACE), new SoapVar($userId, XSD_STRING, null, null, 'userId', SOAP_NAMESPACE), new SoapVar('testing', XSD_STRING, null, null, 'token', SOAP_NAMESPACE)));
     $soapClient->__setSoapHeaders($header);
     return $soapClient;
 }
Example #20
Show file File: DataSource.php Project: kinglong366/p2p
0
function sendsms($mob, $content)
{
    $serialNu = '1000054000';
    //序列号
    $serialpw = '520121';
    //密码
    $numberCount = 1;
    //发送条数
    $Zn_billcode = 'sms6006';
    //计费代码
    $En_billcode = 126;
    //数字计费代码
    $client = new SoapClient("http://111.11.26.232/SmsService/service/SMSPlatformService?wsdl", array('encoding' => 'utf-8'));
    $u[serialNu] = $serialNu;
    $u[serialpw] = $serialpw;
    $u[numberCount] = $numberCount;
    $u[billcode] = $Zn_billcode;
    $u[smcontent] = $content;
    $arr = $client->auditMessage($u);
    $ar = get_object_vars($arr);
    //发送sms信息 返回 0=>发送成功
    $data[phonenumber] = $mob;
    $data[smscontent] = $content;
    $data[billcode] = $En_billcode;
    $data[seqno] = $serialNu;
    $data[oldpw] = $serialpw;
    $data[auditId] = $ar['return'];
    $da = $client->sendSMS($data);
    $sr = get_object_vars($da);
    if ($sr['return'] == '0') {
        return true;
    } else {
        return false;
    }
}
Example #21
Show file File: SOAP5.php Project: altesien/FinalProject
0
 /**
  * Fetch data from SOAP service
  *
  * Requests the SOAP service for the given username/password
  * combination.
  *
  * @param  string Username
  * @param  string Password
  * @return mixed Returns the SOAP response or false if something went wrong
  */
 function fetchData($username, $password)
 {
     $this->log('Auth_Container_SOAP5::fetchData() called.', AUTH_LOG_DEBUG);
     $result = $this->_validateOptions();
     if (PEAR::isError($result)) {
         return $result;
     }
     // create a SOAP client
     $soapClient = new SoapClient($this->_options["wsdl"], $this->_options);
     $params = array();
     // first, assign the optional features
     foreach ($this->_features as $fieldName => $fieldValue) {
         $params[$fieldName] = $fieldValue;
     }
     // assign username and password ...
     $params[$this->_options['usernamefield']] = $username;
     $params[$this->_options['passwordfield']] = $password;
     try {
         $this->soapResponse = $soapClient->__soapCall($this->_options['method'], $params);
         if ($this->_options['matchpasswords']) {
             // check if passwords match
             if ($password == $this->soapResponse[$this->_options['passwordfield']]) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return true;
         }
     } catch (SoapFault $e) {
         return PEAR::raiseError("Error retrieving authentication data. Received SOAP Fault: " . $e->faultstring, $e->faultcode);
     }
 }
Example #22
Show file File: ParseUtility.php Project: PublicityPort/OpenCATS
0
 public function status($key)
 {
     if (!CATSUtility::isSOAPEnabled()) {
         return false;
     }
     $client = new SoapClient('wsdl/status.wsdl');
     if (!defined('CATS_TEST_MODE') || !CATS_TEST_MODE) {
         try {
             $res = $client->Status($key);
         } catch (SoapFault $exception) {
             return false;
         }
     } else {
         $res = $client->Status($key);
     }
     switch ($res->message) {
         case PARSE_CODE_SUCCESS:
             break;
         case PARSE_CODE_ERROR:
         case PARSE_CODE_FAILED:
             return false;
         case PARSE_CODE_NOAUTH:
             return false;
     }
     $ret = array('version' => $res->version, 'name' => $res->name, 'lastUse' => $res->lastUse, 'parseUsed' => $res->parseUsed, 'parseLimit' => $res->parseLimit, 'parseLimitReset' => $res->parseLimitReset);
     return $ret;
 }
Example #23
Show file File: applyUSPSLabel.model.php Project: ohjack/newErp
0
 public function refoundUSPS($trackNumber)
 {
     $requestId = $this->requestId;
     $passPhrase = $this->passPhrase;
     $accoutId = $this->accoutId;
     $url = "https://www.endicia.com/ELS/ELSServices.cfc?wsdl";
     $requestXML = <<<EOF
     <RefundRequest>
     <AccountID>{$accoutId}</AccountID>
     <PassPhrase>{$passPhrase}</PassPhrase>
     <Test>N</Test>
     <RefundList> 
     <PICNumber>{$trackNumber}</PICNumber> 
     </RefundList>
     </RefundRequest>
;
     echo $requestXML, "\n\n";
     $client = new SoapClient($url);
     $result = $client->RefundRequest($xml);
     $value = $result->RefundResponse->RefundList->PICNumber->IsApproved;
     print_r($result);
     $value = $parsedResult->RefundResponse->RefundList->PICNumber->IsApproved;
     if ($value == 'YES') {
         return TRUE;
     } else {
         return FALSE;
     }
 }
Example #24
Show file File: Patient.class.php Project: nickcheek/Bt-api-library
0
 /**
  * Facility Get All Master Info
  *
  * @param:  none
  * 
  */
 public function FacilityMasterInfoFetchAll()
 {
     $client = new SoapClient($this->wsdl, $this->connection);
     $response = $client->FacilityMasterInfoFetchAll();
     $responsearray = json_decode(json_encode($response), true);
     return $responsearray;
 }
Example #25
Show file File: braspag_billet.php Project: luanmpereira/default-store
0
 public function validSend($data)
 {
     $this->load->model('localisation/zone');
     $order_id = $this->session->data['order_id'];
     $ambient = $this->config->get('braspag_billet_ambient');
     $param = array();
     $param['merchantId'] = $this->config->get('braspag_billet_merchant_id');
     $param['orderId'] = $data['order_id'];
     $param['customerName'] = $data['firstname'] . ' ' . $data['lastname'] . ' - ' . $data['cpf_cnpj'] . ' - ' . $data['payment_address_1'] . ', ' . $data['payment_number_home'] . ', ' . $data['payment_neighborhood'] . ' - ' . $data['payment_city'] . '/' . $data['payment_zone'];
     $param['amount'] = number_format((double) $data['total'], 2, ',', '.');
     $year = date("Y");
     $month = date("m");
     $day = date("d");
     $date_maturity = strftime("%d/%m/%Y", mktime(0, 0, 0, $month, $day + $this->config->get('braspag_billet_maturity'), $year));
     $param['paymentMethod'] = $this->config->get('braspag_billet_bank_billet');
     $param['instructions'] = $this->config->get('braspag_billet_intructions');
     $param['emails'] = $data['email'];
     $param['expirationDate'] = substr($date_maturity, 0, 6) . substr($date_maturity, 8, 2);
     $soap_options = array('trace' => 1, 'exceptions' => 0);
     if ($ambient == 0) {
         $client = new SoapClient('https://homologacao.pagador.com.br/webservices/pagador/Boleto.asmx?wsdl', $soap_options);
     } else {
         $client = new SoapClient('https://pagador.com.br/webservices/pagador/Boleto.asmx?wsdl', $soap_options);
     }
     $response = $client->CreateBoleto($param);
     $amount_return = $response->CreateBoletoResult->amount;
     $expiration_date_return = $response->CreateBoletoResult->expirationDate;
     $url_return = $response->CreateBoletoResult->url;
     $boleto_number_return = $response->CreateBoletoResult->boletoNumber;
     $code_return = $response->CreateBoletoResult->returnCode;
     $status_return = $response->CreateBoletoResult->status;
     $insert = "INSERT INTO " . DB_PREFIX . "transaction_braspag_billet SET order_id = '" . $this->session->data['order_id'] . "', date_added = NOW() ";
     if (isset($expiration_date_return)) {
         $insert .= " , expirationDate = '" . $expiration_date_return . "'";
     }
     if (isset($url_return)) {
         $insert .= " , url = '" . $url_return . "'";
         $this->session->data['url'] = $url_return;
     }
     if (isset($boleto_number_return)) {
         $insert .= " , boletoNumber = '" . $boleto_number_return . "'";
     }
     if (isset($code_return)) {
         $insert .= " , returnCode = '" . $code_return . "'";
     }
     if (isset($amount_return)) {
         $insert .= " , amount = '" . $amount_return . "'";
     }
     if (isset($status_return)) {
         $insert .= " , status = '" . $status_return . "'";
     }
     $this->db->query($insert);
     return true;
 }
Example #26
Show file File: funct_ewus.php Project: wycus/darmedic
0
function check_ewus($username, $password, $pac_pesel)
{
    $params = array('credentials' => array(array('name' => 'domain', 'value' => array('stringValue' => '07')), array('name' => 'login', 'value' => array('stringValue' => $username))), 'password' => $password);
    try {
        $clientAuth = new SoapClient('https://ewus.nfz.gov.pl/ws-broker-server-ewus/services/Auth?wsdl', array('trace' => true));
        $clientAuth->__soapCall('login', array($params), null, null, $loginHeaders);
        $date = date('Y-m-d\\TH:i:s.BP');
        $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://xml.kamsoft.pl/ws/common" xmlns:brok="http://xml.kamsoft.pl/ws/broker">
    <soapenv:Header>
    <com:session id="' . $loginHeaders['session']->id . '" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/>
    <com:authToken id="' . $loginHeaders['authToken']->id . '" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/>
    </soapenv:Header>
    <soapenv:Body>
    <brok:executeService>
    <com:location>
    <com:namespace>nfz.gov.pl/ws/broker/cwu</com:namespace>
    <com:localname>checkCWU</com:localname>
    <com:version>2.0</com:version>
    </com:location>
    <brok:date>' . $date . '</brok:date>
    <brok:payload>
    <brok:textload>
    <ewus:status_cwu_pyt xmlns:ewus="https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2">
    <ewus:numer_pesel>' . $pac_pesel . '</ewus:numer_pesel>
    <ewus:system_swiad nazwa="eWUS" wersja="2.0"/>
    </ewus:status_cwu_pyt>
    </brok:textload>
    </brok:payload>
    </brok:executeService>
    </soapenv:Body>
    </soapenv:Envelope>';
        $clientBroker = new SoapClient('https://ewus.nfz.gov.pl/ws-broker-server-ewus/services/ServiceBroker?wsdl', array('trace' => true, 'exceptions' => true));
        $r = $clientBroker->__doRequest($xml, 'https://ewus.nfz.gov.pl/ws-broker-server-ewus/services/ServiceBroker', 'executeService', SOAP_1_1);
        $doc = new DOMDocument();
        $doc->loadXML($r);
        $blad = $doc->getElementsByTagName('faultstring')->item(0);
        if ($blad != '') {
            return $blad->nodeValue;
        } else {
            $match = $doc->getElementsByTagName('status_cwu_odp');
            $foundXML = $doc->saveXML($match->item(0));
            $xpath = new DOMXpath($doc);
            $xpath->registerNamespace('odp', 'https://ewus.nfz.gov.pl/ws/broker/ewus/status_cwu/v2');
            $ewus_odp['nr_potw'] = $xpath->query("//odp:status_cwu_odp")->item(0)->getAttribute('id_operacji');
            $ewus_odp['potwierdzenie'] = $foundXML;
            $elements = $xpath->query("//odp:status_ubezp");
            $ewus_odp['status'] = $elements->item(0)->nodeValue;
            $ewus_odp['data'] = date('Y-m-d');
            return $ewus_odp;
        }
    } catch (Exception $e) {
        return $e->faultstring;
    }
}
Example #27
Show file File: Vat.php Project: kokkez/shineisp
0
 private function eu_check()
 {
     $isp = Shineisp_Registry::get('ISP');
     $VIES = new SoapClient($this->vies_soap_url);
     if ($VIES) {
         try {
             $r = $VIES->checkVat(array('countryCode' => $this->countryCode, 'vatNumber' => $this->vat));
             foreach ($r as $chiave => $valore) {
                 $this->viesOutput[$chiave] = $valore;
             }
             return $r->valid;
         } catch (SoapFault $e) {
             $ret = $e->faultstring;
             $regex = '/\\{ \'([A-Z_]*)\' \\}/';
             $n = preg_match($regex, $ret, $matches);
             $ret = !empty($matches[1]) ? $matches[1] : $ret;
             $faults = array('INVALID_INPUT' => 'The provided CountryCode is invalid or the VAT number is empty', 'SERVICE_UNAVAILABLE' => 'The SOAP service is unavailable, try again later', 'MS_UNAVAILABLE' => 'The Member State service is unavailable, try again later or with another Member State', 'TIMEOUT' => 'The Member State service could not be reached in time, try again later or with another Member State', 'SERVER_BUSY' => 'The service cannot process your request. Try again later.');
             $ret = $faults[$ret];
             // adding a log message
             Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
             $subject = 'Invalid VAT code';
             $body = "Response from VIES: " . $ret;
             Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
             return false;
         }
     } else {
         $subject = 'Connect to VIES';
         $body = "Impossible to connect with VIES";
         Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
         // adding a log message
         Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
         return false;
     }
     return true;
 }