本文整理汇总了PHP中SoapClient类的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient类的具体用法?PHP SoapClient怎么用?PHP SoapClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SoapClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: calculoAportacionCiudadano
/**
*
* @param array $param
* <br>Parámetros de entrada.
* @return array
*/
function calculoAportacionCiudadano($param)
{
global $respError, $farmacia;
$param = objectToArray($param);
//die(print_r($param));
if ($farmacia == FARMACIA_DEBUG or strlen(FARMACIA_DEBUG) == 0) {
if (DEBUG & DEBUG_LOG) {
$mensaje = print_r($param, TRUE);
$mensaje .= "--Llamada hecha en el fichero: " . __FILE__ . ", en la línea: " . __LINE__;
error_log("[" . date("c") . "] \r\n {$mensaje}", 3, DIRECTORIO_LOG . __FUNCTION__ . "_" . date("YmdH") . ".log");
}
}
unset($param["farmacia"]);
unset($param["DNI"]);
$client = new SoapClient(END_POINT, array("location" => LOCATION, "trace" => true, "exceptions" => false));
$result = $client->__soapCall(__FUNCTION__, array($param));
//die(print_r($result));
if (is_soap_fault($result)) {
if ($farmacia == FARMACIA_DEBUG or strlen(FARMACIA_DEBUG) == 0) {
if (DEBUG & DEBUG_LOG) {
$mensaje = "REQUEST:\n" . $client->__getLastRequest() . "\n";
$mensaje .= "RESPONSE:\n" . $client->__getLastResponse() . "\n";
$mensaje .= "RESULT:\n" . $result . "\n";
$mensaje .= "--SOAP FAULT, llamada hecha en el fichero: " . __FILE__ . ", en la línea: " . __LINE__ . "\n";
error_log("[" . date("c") . "] \r\n {$mensaje}", 3, DIRECTORIO_LOG . __FUNCTION__ . "_" . date("YmdH") . ".log");
}
}
return array(__FUNCTION__ . "Result" => array("return" => $result->return, "resultadoOperacion" => array("codigoResultadoOperacion" => -9000, "mensajeResultadoOperacion" => $result->faultstring)));
}
return array(__FUNCTION__ . "Result" => array("return" => $result->return, "resultadoOperacion" => $respError->sinErrores()));
}
开发者ID:Veridata,项目名称:SISCATA,代码行数:37,代码来源:calculoAportacionCiudadano.php
示例2: findReservation
public function findReservation($debut, $fin)
{
$configResaBooking = $this->em->find('BackResaBookingBundle:Configuration', 1);
$client = new \SoapClient($configResaBooking->getWsdl());
$request = array($configResaBooking->getLogin(), $configResaBooking->getPassword(), $debut, $fin);
return $client->__soapCall('findreservation', $request);
}
开发者ID:NadaNafti,项目名称:Thalassa,代码行数:7,代码来源:ResaBookingService.php
示例3: create_iDeal_box
function create_iDeal_box()
{
if ($this->query_bankinfo) {
$client = new SoapClient($this->wsdl);
$params->merchantID = MODULE_PAYMENT_ICEPAY_MERCHANT_ID;
$params->secretCode = MODULE_PAYMENT_ICEPAY_SECRET;
$ideal_object = $client->GetIDEALIssuers($params);
$ideal_issuers = $ideal_object->GetIDEALIssuersResult->string;
$ideal_issuers_arr = array();
foreach ($ideal_issuers as $ideal_issuer) {
$ideal_issuers_arr[] = array('id' => $ideal_issuer, 'text' => $ideal_issuer);
}
} else {
$ideal_issuers_arr[] = array('id' => 'ABNAMRO', 'text' => 'ABN AMRO');
$ideal_issuers_arr[] = array('id' => 'ASNBANK', 'text' => 'ASN Bank');
$ideal_issuers_arr[] = array('id' => 'FRIESLAND', 'text' => 'Friesland Bank');
$ideal_issuers_arr[] = array('id' => 'ING', 'text' => 'ING');
$ideal_issuers_arr[] = array('id' => 'RABOBANK', 'text' => 'Rabobank');
$ideal_issuers_arr[] = array('id' => 'SNSBANK', 'text' => 'SNS Bank');
$ideal_issuers_arr[] = array('id' => 'SNSREGIOBANK', 'text' => 'SNS Regio Bank');
$ideal_issuers_arr[] = array('id' => 'TRIODOSBANK', 'text' => 'Triodos Bank');
$ideal_issuers_arr[] = array('id' => 'VANLANSCHOT', 'text' => 'Van Lanschot');
}
$dropdown = '<select name="ic_issuer" >';
foreach ($ideal_issuers_arr as $ideal_issuer) {
$dropdown .= '<option value="' . $ideal_issuer['id'] . '" >' . $ideal_issuer['text'] . '</option>';
}
$dropdown .= '</select>';
$create_iDeal_box = "<div style=\"margin-right:20px; display:block; float:left;\">" . Translate('Kies uw bank voor het afrekenen met iDEAL: ') . $dropdown . "</div>";
return $create_iDeal_box;
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:31,代码来源:icepay_ideal.php
示例4: check_vat
/**
* Check a given VAT number with the europe VIES check
*
* @param string $country The country code to check with the VAT number.
* @param string $vat_nr The VAT number to check.
*
* @return bool|null
*/
private function check_vat($country, $vat_nr)
{
$country = trim($country);
$vat_nr = trim($vat_nr);
// Strip all spaces from the VAT number to improve usability of the VAT field.
$vat_nr = str_replace(' ', '', $vat_nr);
if (0 === strpos($vat_nr, $country)) {
$vat_nr = trim(substr($vat_nr, strlen($country)));
}
try {
// Do the remote request.
$client = new \SoapClient('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl');
$returnVat = $client->checkVat(array('countryCode' => $country, 'vatNumber' => $vat_nr));
} catch (\Exception $e) {
error_log('VIES API Error for ' . $country . ' - ' . $vat_nr . ': ' . $e->getMessage());
return 2;
}
// Return the response.
if (isset($returnVat)) {
if (true == $returnVat->valid) {
return 1;
} else {
return 0;
}
}
// Return null if the service is down.
return 2;
}
开发者ID:apsolut,项目名称:Yoast-theme-public,代码行数:36,代码来源:class-checkout.php
示例5: registerUser
/**
* 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);
}
}
开发者ID:Yatko,项目名称:Gifteng,代码行数:40,代码来源:InviteController.php
示例6: track
public function track($trackingNumber)
{
if (!isset($trackingNumber)) {
return false;
}
//The WSDL is not included with the sample code.
//Please include and reference in $path_to_wsdl variable.
$path_to_wsdl = __DIR__ . DIRECTORY_SEPARATOR . 'TrackService_v9.wsdl';
ini_set("soap.wsdl_cache_enabled", "0");
$client = new \SoapClient($path_to_wsdl, array('trace' => 1));
// Refer to http://us3.php.net/manual/en/ref.soap.php for more information
$request['WebAuthenticationDetail'] = array('UserCredential' => array('Key' => $this->authKey, 'Password' => $this->authPassword));
$request['ClientDetail'] = array('AccountNumber' => $this->authAccountNumber, 'MeterNumber' => $this->authMeterNumber);
$request['TransactionDetail'] = array('CustomerTransactionId' => '*** Track Request using PHP ***');
$request['Version'] = array('ServiceId' => 'trck', 'Major' => '9', 'Intermediate' => '1', 'Minor' => '0');
$request['SelectionDetails'] = array('PackageIdentifier' => array('Type' => 'TRACKING_NUMBER_OR_DOORTAG', 'Value' => $trackingNumber));
try {
if ($this->setEndpoint('changeEndpoint')) {
$newLocation = $client->__setLocation(setEndpoint('endpoint'));
}
$response = $client->track($request);
$this->responseToArray($response);
return $response;
} catch (SoapFault $exception) {
$this->printFault($exception, $client);
}
}
开发者ID:previewict,项目名称:phpie,代码行数:27,代码来源:Track.php
示例7: createRatesClient
function createRatesClient()
{
$client = new SoapClient("EstimatingService.wsdl", array('trace' => true, 'location' => "https://webservices.purolator.com/PWS/V1/Estimating/EstimatingService.asmx", 'uri' => "http://purolator.com/pws/datatypes/v1", 'login' => PRODUCTION_KEY, 'password' => PRODUCTION_PASS));
$headers[] = new SoapHeader('http://purolator.com/pws/datatypes/v1', 'RequestContext', array('Version' => '1.0', 'Language' => 'en', 'GroupID' => 'xxx', 'RequestReference' => 'Rating Example'));
$client->__setSoapHeaders($headers);
return $client;
}
开发者ID:richhl,项目名称:sfCartPlugin,代码行数:7,代码来源:purolator.class.php
示例8: send
public function send($destination, $text)
{
$client = new SoapClient(self::URL);
$sendResult = array('sent' => false, 'message' => '');
$result = $client->Auth(array('login' => self::LOGIN, 'password' => self::PASS));
var_dump($result);
if ($result->AuthResult != 'Вы успешно авторизировались') {
$sendResult['message'] = 'Не удалось авторизоваться';
return $sendResult;
}
$result = $client->GetCreditBalance();
if ($result->GetCreditBalanceResult <= 0) {
$sendResult['message'] = 'Недостаточно средств для отправки';
return false;
}
$destination = $this->formatPhone($destination);
if (!$destination) {
$sendResult['message'] = 'Неверный формат номера получателя';
return $sendResult;
}
$sms = array('sender' => self::SENDER, 'destination' => $destination, 'text' => $text);
//echo "try to send sms to ".$destination." from ".$sender." with message = ".$text;
// Подпись отправителя может содержать английские буквы и цифры. Максимальная длина - 11 символов.
// Номер указывается в полном формате, включая плюс и код страны
$result = $client->SendSMS($sms);
if ($result->SendSMSResult->ResultArray[0] != 'Сообщения успешно отправлены') {
var_dump($result->SendSMSResult);
$sendResult['message'] = $result->SendSMSResult->ResultArray[0];
return $sendResult;
}
$sendResult['sent'] = true;
return $sendResult;
}
开发者ID:cosmolady,项目名称:cosmolady.github.io,代码行数:33,代码来源:TurboSMS.php
示例9: creaFormularioProductos
function creaFormularioProductos()
{
$productos = BD::obtieneProductos();
$uri = "http://localhost/tienda/recursos_u5/TiendaOnlineOO/tienda";
$url = "{$uri}/servicio_sin_wdsl.php";
$cliente = new SoapClient(null, array('location' => $url, 'uri' => $uri, 'trace' => true));
foreach ($productos as $p) {
echo "<p><form id='" . $p->getcodigo() . "' action='productos.php' method='post'>";
// Metemos ocultos los datos de los productos
echo "<input type='hidden' name='cod' value='" . $p->getcodigo() . "'/>";
echo "<input type='submit' name='enviar' value='Añadir'/>";
echo $p->getnombrecorto() . ": ";
echo $p->getPVP() . " euros.";
echo "<input type='submit' name='detalle' value='Mostrar detalle'/>";
echo "</p>";
echo "</form>";
if (isset($_POST['detalle'])) {
if ($_POST['cod'] == $p->getcodigo()) {
try {
//$unproducto=$cliente->obtieneProducto($p->getcodigo());
//echo $unproducto->getPVP();
$unprecio = $cliente->obtienePrecioProducto($p->getcodigo());
print "<p>Precio :" + $unprecio + "</p>";
} catch (Exception $e) {
echo "Exception: " . $e->getMessage();
}
// echo $p->getPVP();
echo "<p>" + $p->getcodigo() + "</p>";
echo "<p>" + $p->getnombre() + "</p>";
echo "<p>:" + $p->muestra() + "</p>";
}
}
}
}
开发者ID:jjaviergr,项目名称:tienda_soap_ejemplo_basico,代码行数:34,代码来源:productos.php
示例10: detail
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(" ", "", strip_tags($data['InfoContent']));
$arr['click_times'] = $data['ClickTimes'];
//点击次数
//hg_pre($arr);exit();
return $arr;
}
开发者ID:h3len,项目名称:Project,代码行数:29,代码来源:service_rdwd.class.php
示例11: back_from_bank
function back_from_bank($Amount, $config, $transids, $lang)
{
if ($_GET['Status'] == 'OK') {
$client = new SoapClient('https://de.zarinpal.com/pg/services/WebGate/wsdl', array('encoding' => 'UTF-8'));
$result = $client->PaymentVerification(array('MerchantID' => $config['merchent_code'], 'Authority' => $_GET['Authority'], 'Amount' => $Amount / 10));
$tracking_code = $result->RefID;
$result = $result->Status;
if ($result == 100) {
$show['Status'] = 1;
$show['massage'] = $lang['Successful']['back'];
$show['trans_id1'] = $tracking_code;
$show['trans_id2'] = $_GET['Authority'];
} else {
$show['Status'] = 0;
$show['massage'] = $lang['error'][$result];
$show['trans_id1'] = $tracking_code;
$show['trans_id2'] = $_GET['Authority'];
}
} else {
$show['Status'] = 0;
$show['massage'] = $lang['error']['not_back'];
$show['trans_id1'] = $tracking_code;
$show['trans_id2'] = $_GET['Authority'];
}
return $show;
}
开发者ID:ZarinPal-Lab,项目名称:RaPayment,代码行数:26,代码来源:function.php
示例12: ValidateWithWebServiceSAT
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;
}
}
开发者ID:njmube,项目名称:CSDOCSCFDI,代码行数:27,代码来源:Receipt.php
示例13: fetchData
/**
* You can specify a custom import.
* @return bool
*/
public function fetchData()
{
$wsdl = FleximportConfig::get("SEMIRO_SOAP_PARTICIPANTS_WSDL");
$soap = new SoapClient($wsdl, array('trace' => 1, 'exceptions' => 0, 'cache_wsdl' => $GLOBALS['CACHING_ENABLE'] || !isset($GLOBALS['CACHING_ENABLE']) ? WSDL_CACHE_BOTH : WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$file = strtolower(substr($wsdl, strrpos($wsdl, "/") + 1));
$soapHeaders = new SoapHeader($file, 'Header', array('pw' => FleximportConfig::get("SEMIRO_SOAP_PASSWORD")));
$soap->__setSoapHeaders($soapHeaders);
$result = $soap->getTeilnehmerXML(array('pw' => FleximportConfig::get("SEMIRO_SOAP_PASSWORD")));
if (is_a($result, "SoapFault")) {
throw new Exception("SOAP-error: " . $result->faultstring);
}
$fields = array();
$doc = new DOMDocument();
$doc->loadXML(studip_utf8decode($result->return));
$seminar_data = array();
foreach ($doc->getElementsByTagName("teilnehmer") as $seminar) {
$seminar_data_row = array();
foreach ($seminar->childNodes as $attribute) {
if ($attribute->tagName) {
if (!in_array(studip_utf8decode(trim($attribute->tagName)), $fields)) {
$fields[] = studip_utf8decode(trim($attribute->tagName));
}
$seminar_data_row[] = studip_utf8decode(trim($attribute->nodeValue));
}
}
$seminar_data[] = $seminar_data_row;
}
$this->table->createTable($fields, $seminar_data);
}
开发者ID:Krassmus,项目名称:Fleximport,代码行数:33,代码来源:fleximport_semiro_participant_import.php
示例14: valida_cfdi
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;
}
开发者ID:njmube,项目名称:CSDOCSCFDI,代码行数:33,代码来源:webservice_sat.php
示例15: GetRegZavod
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();
}
}
开发者ID:lidijakralj,项目名称:bober,代码行数:28,代码来源:RegisterZavodov.php
示例16: soap_call
/**
* Make a call to a SoapClient
*
* @param SoapClient $connection The SoapClient to call
* @param string $call Operation to be performed by client
* @param array $params Parameters for the call
* @return mixed The return parameters of the operation or a SoapFault
* If the operation returned several parameters then these
* are returned as an object rather than an array
*/
function soap_call($connection, $call, $params)
{
try {
$return = $connection->__soapCall($call, $params);
} catch (SoapFault $f) {
$return = $f;
} catch (Exception $e) {
$return = new SoapFault('client', 'Could call the method');
}
// return multiple parameters using an object rather than an array
if (is_array($return)) {
$keys = array_keys($return);
$assoc = true;
foreach ($keys as $key) {
if (!is_string($key)) {
$assoc = false;
break;
}
}
if ($assoc) {
$return = (object) $return;
}
}
return $return;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:35,代码来源:phpsoap.php
示例17: login
public function login($email, $pass, $options = array())
{
// Import the supplied options.
$this->options = array_merge($this->options, $options);
// Debug
$this->error("Logging in as {$email} to {$this->options['alias']}.");
$url_header = @get_headers($this->getUrl());
if ($url_header[0] == 'HTTP/1.1 404 Not Found' || !$url_header) {
return false;
}
// Authenticating and save session key
$authClient = new SoapClient($this->getUrl(), $this->soap_options);
$response = $authClient->AuthenticateWebSafe(array('email' => $email, 'pass' => $pass));
// Bad login case
if ($response->AuthenticateWebSafeResult->Code == "Not_Found") {
return false;
} else {
if ($response->AuthenticateWebSafeResult->Code == "Success") {
// Save the session key in class and session
$this->VeetroSession = $response->AuthenticateWebSafeResult->SessionKey;
$this->User = $response;
$this->session('VeetroSession', $this->VeetroSession);
$this->session('UserID', (string) $response->AuthenticateWebSafeResult->User->EntityID);
$this->session('User', $response->AuthenticateWebSafeResult->User);
$this->error("Saving new session key {$this->VeetroSession}.");
// Connect to api with VeetroHeader.
$this->connect();
return true;
} else {
$this->error("Unknown auth response code: {$response->AuthenticateWebSafeResult->Code}", self::ERROR);
die(print_r($response, true));
}
}
}
开发者ID:rongandat,项目名称:scalaprj,代码行数:34,代码来源:worketc.php
示例18: soapRequest
public static function soapRequest($args)
{
// get SOAP function name to call
if (!isset($args['action'])) {
die("No action specified.");
}
$function_name = $args['action'];
// remove function name from arguments
unset($args['action']);
// prepend username/passwords to arguments
$args = array_merge(self::$conf, $args);
// connect and do the SOAP call
try {
$client = new SoapClient(self::$mantisConnectUrl . '?wsdl');
$result = $client->__soapCall($function_name, $args);
echo "URL : " . self::$mantisConnectUrl . '?wsdl' . "<br>";
echo "Method : " . $function_name . "<br>";
echo "Args : " . "<br>";
var_dump($args);
echo "<br>";
} catch (SoapFault $e) {
self::$logger->error("Error with Mantis SOAP", $e);
$result = array('error' => $e->faultstring);
}
return $result;
}
开发者ID:fg-ok,项目名称:codev,代码行数:26,代码来源:soap.php
示例19: eForm2MailBuild
function eForm2MailBuild(&$fields)
{
$params = new stdclass();
$params->ApiKey = MB_API_KEY;
$params->ListID = MB_LIST_ID;
$params->Name = $fields['first_name'] . ' ' . $fields['last_name'];
$params->Email = $fields['email'];
try {
$client = new SoapClient("http://api.createsend.com/api/api.asmx?wsdl", array('trace' => 1));
$result = get_object_vars($client->AddSubscriber($params));
$resultCode = current($result)->Code;
$resultMessage = current($result)->Message;
// If not successful
if ($resultCode > 0) {
$isError = true;
}
// The following code produces the entire service request and response. It may be useful for debugging.
/*
print "<pre>\n";
print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n";
print "</pre>";
*/
} catch (SoapFault $e) {
// mail('[email protected]', 'error processing form', $e->getMessage()); // Uncomment and replace email address if you want to know when something goes wrong.
// print_r($e); die(); // Uncomment to spit out debugging information and die on error.
}
return true;
}
开发者ID:brettflorio,项目名称:eform2mailbuild,代码行数:29,代码来源:eform2mailbuild.snippet.php
示例20: actionTest
public function actionTest()
{
$wsdlUrl = Yii::app()->request->hostInfo . $this->createUrl('user');
$client = new SoapClient($wsdlUrl);
echo "<pre>";
echo "login...\n";
$client->login('admin', '1234qwe');
echo "fetching all contacts\n";
//echo $client->login('admin','1234qwe');
echo "<br/>";
print_r($client->getUsers());
//CVarDumper::dump($client->getUsers());
echo "<br/>";
echo Yii::app()->request->hostInfo . $this->createUrl('user');
echo "<br/>";
echo "\ninserting a new contact...";
$model = new sUser();
$model->username = 'Tester';
$model->password = '1234qwe';
$model->salt = '1234qwe';
$model->default_group = 1;
$model->status_id = 1;
$model->created_date = time();
$model->created_by = "admin";
$client->saveUser($model);
echo "done\n\n";
echo "fetching all contacts\n";
print_r($client->getUsers());
echo "</pre>";
}
开发者ID:rusli-nasir,项目名称:ERP_Accounting_Indonesia,代码行数:30,代码来源:wsSiteController.php
注:本文中的SoapClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论