本文整理汇总了PHP中nusoap_client::getDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP nusoap_client::getDebug方法的具体用法?PHP nusoap_client::getDebug怎么用?PHP nusoap_client::getDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nusoap_client
的用法示例。
在下文中一共展示了nusoap_client::getDebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setClientSoap
/**
* Permet de mettre en place le client de la requête en fonction du WSDL.
*
* @param $urlWsdl
* @return \nusoap_client
*/
private function setClientSoap($urlWsdl)
{
// Instanciation du client SOAP
$this->client = new \nusoap_client($urlWsdl, false, false, false, false, false, 0, 1000);
$this->client->soap_defencoding = 'UTF-8';
$this->client->decode_utf8 = false;
// Mise en place des options CURL
// Option curl
$this->client->setUseCurl(true);
// Mise en place du SSl si on l'active
if ($this->enabledSSL) {
// Mise en place des données d'authentification SSL
$certRequest = array('cainfofile' => $this->caChainClientLocation, 'sslcertfile' => $this->certClientLocation, 'sslkeyfile' => $this->privateKeyClientLocation, 'passphrase' => $this->privateKeyClientPassword);
$this->client->setCredentials('', '', 'certificate', $certRequest);
$this->client->setCurlOption(CURLOPT_SSLVERSION, 3);
// @TODO : cette option sera à mettre à true. On utilisera un fichier contenant l'AC Yousign en tant que trustore
$this->client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
}
// @TODO : voir comment on lève une exception
$err = $this->client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($this->client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
return $this->client;
}
示例2: LeerRegistro
function LeerRegistro()
{
// la variable $llave permite retornar alguna marca que esté en el formato de salida
// identificada entre $$LLAVE= .....$$
$llave_pft = "";
global $llamada, $valortag, $maxmfn, $arrHttp, $OS, $Bases, $xWxis, $Wxis, $Mfn, $db_path, $wxisUrl, $empwebservicequerylocation, $empwebserviceusersdb, $db;
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client($empwebservicequerylocation, false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
$params = array('queryParam' => array("query" => array('login' => $arrHttp["login"])), 'database' => $empwebserviceusersdb);
$result = $client->call('searchUsers', $params, 'http://kalio.net/empweb/engine/query/v1', '');
//print_r($result);
//die;
$myllave = "";
//Esto se ha complejizado con el asunto de la incorporación de mas de una base de datos
if (is_array($result['queryResult']['databaseResult']['result']['userCollection'])) {
$vectoruno = $result['queryResult']['databaseResult']['result']['userCollection'];
if (is_array($vectoruno['user'])) {
//Hay una sola base y ahí está el usuario
$myuser = $vectoruno['user'];
$db = $empwebserviceusersdb;
} else {
if (is_array($vectoruno[0])) {
// hay un vector de dbnames, hay que encontrar en cual de ellos está el user, si está en mas de uno
// joderse, se toma el primero
foreach ($vectoruno as $elementos) {
if (is_array($elementos['user'])) {
$myuser = $elementos['user'];
$db = $elementos['!dbname'];
}
}
}
}
// Con el myuser recuperado me fijo si es que el passwd coincide
if ($myuser['password'] == $arrHttp["password"] && strlen($arrHttp["password"]) > 3) {
$vectorAbrev = $myuser;
//print_r($vectorAbrev);
//die;
$myllave = $vectorAbrev['id'] . "|";
$myllave .= "1|";
$myllave .= $vectorAbrev['name'] . "|";
$valortag[40] = "\n";
}
}
return $myllave;
}
示例3: routeToCrm
public function routeToCrm($host, $username, $password, $databaseName)
{
if (isset($_COOKIE['username'])) {
$user = $_COOKIE['username'];
}
if (isset($_COOKIE['mdp'])) {
//Récupération du mot de passe stocké
$db = new MysqliDb($host, $username, $password, $databaseName);
$db->where("user_name", $user);
$users = $db->getOne("users");
$pwd = $users['user_hash'];
// Création du mot de passe hashé
// $mdp = crypt(strtolower($_COOKIE['mdp']),$pwd);
$mdp = $_COOKIE['mdp'];
}
// Login au CRM
$url = "http://localhost/mysite/crm74/service/v4_1/soap.php?wsdl";
require_once "../crm74/include/nusoap/lib/nusoap.php";
//retrieve WSDL
$client = new nusoap_client($url, 'wsdl');
$proxy = $client->getProxy();
//Affichage des erreurs
$err = $client->getError();
if ($err) {
echo '<h2>Erreur du constructeur</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
// login ----------------------------------------------------
$login_parameters = array('user_auth' => array('user_name' => $user, 'password' => $mdp, 'version' => '1'), 'application_name' => 'SugarTest');
$login_result = $client->call('login', $login_parameters);
echo '<pre>';
//get session id
$session_id = $login_result['id'];
$result = $proxy->seamless_login($session_id);
// Ouverture de la session SuiteCRM
header("Location: http://localhost/mysite/crm74/index.php?module=Administration&action=index&MSID={$session_id}");
}
示例4: array
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
exit;
}
$client->setUseCurl($useCURL);
$params = array('isbn' => '0060188782');
$result = $client->call('getPrice', $params);
// Check for a fault
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>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Cache Debug</h2><pre>' . htmlspecialchars($cache->getDebug(), ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
示例5: createToken
/**
* Create token on eWay.
*
* @param $paymentProcessor
* @param array $params
*
* @return int
* Unique id of the token created to manage this customer in eway.
*
* @throws \CRM_Core_Exception
*/
protected function createToken($paymentProcessor, $params)
{
if (civicrm_api3('setting', 'getvalue', array('group' => 'eway', 'name' => 'eway_developer_mode'))) {
// I'm not sure about setting status as in future we might do this in an api call.
CRM_Core_Session::setStatus(ts('Site is in developer mode. No communication with eway has taken place'));
return uniqid();
}
$gateway_URL = $paymentProcessor['url_recur'];
$soap_client = new nusoap_client($gateway_URL, FALSE);
$err = $soap_client->getError();
if ($err) {
throw new CRM_Core_Exception(htmlspecialchars($soap_client->getDebug(), ENT_QUOTES));
}
// Set namespace.
$soap_client->namespaces['man'] = 'https://www.eway.com.au/gateway/managedpayment';
// Set SOAP header.
$headers = "<man:eWAYHeader><man:eWAYCustomerID>" . $this->_paymentProcessor['subject'] . "</man:eWAYCustomerID><man:Username>" . $this->_paymentProcessor['user_name'] . "</man:Username><man:Password>" . $this->_paymentProcessor['password'] . "</man:Password></man:eWAYHeader>";
$soap_client->setHeaders($headers);
// Add eWay customer.
$requestBody = array('man:Title' => 'Mr.', 'man:FirstName' => $params['first_name'], 'man:LastName' => $params['last_name'], 'man:Address' => $params['street_address'], 'man:Suburb' => $params['city'], 'man:State' => $params['state_province'], 'man:Company' => '', 'man:PostCode' => $params['postal_code'], 'man:Country' => 'au', 'man:Email' => $params['email'], 'man:Fax' => '', 'man:Phone' => '', 'man:Mobile' => '', 'man:CustomerRef' => '', 'man:JobDesc' => '', 'man:Comments' => '', 'man:URL' => '', 'man:CCNumber' => $params['credit_card_number'], 'man:CCNameOnCard' => $this->getCreditCardName($params), 'man:CCExpiryMonth' => $this->getCreditCardExpiryMonth($params), 'man:CCExpiryYear' => $this->getCreditCardExpiryYear($params));
// Hook to allow customer info to be changed before submitting it.
CRM_Utils_Hook::alterPaymentProcessorParams($this, $params, $requestBody);
$soapAction = 'https://www.eway.com.au/gateway/managedpayment/CreateCustomer';
$result = $soap_client->call('man:CreateCustomer', $requestBody, '', $soapAction);
if ($result === FALSE) {
throw new CRM_Core_Exception('Failed to create managed customer - result is FALSE');
} elseif (is_array($result)) {
throw new CRM_Core_Exception('Failed to create managed customer - result (' . implode(', ', array_keys($result)) . ') is (' . implode(', ', $result) . ')');
} elseif (!is_numeric($result)) {
throw new CRM_Core_Exception('Failed to create managed customer - result is ' . $result);
}
return $result;
}
示例6: executeEsitefTest
public function executeEsitefTest(sfWebRequest $request)
{
//$client = new nusoap_client(sfConfig::get('app_esitef_url'), true, false, false, false, false, sfConfig::get('app_esitef_connection_timeout',110), sfConfig::get('app_esitef_response_timeout',110));
$client = new nusoap_client(sfConfig::get('app_esitef_url'), true);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
$transactionRequest = array('transactionRequest' => array('amount' => '45645', 'extraField' => 'bonus', 'merchantId' => 'vendorepuestos', 'merchantUSN' => '18700281', 'orderId' => '18700281'));
$payment = $client->getProxy();
if (!$payment) {
echo '<h2>Fault</h2><pre>';
echo 'No hay proxy';
echo '</pre>';
}
$transactionResponse = $payment->beginTransaction($transactionRequest);
echo '<h2>Begin Transaction Result</h2><pre>';
print_r($transactionResponse['transactionResponse']);
echo '</pre>';
$nit = $transactionResponse['transactionResponse']['nit'];
$paymentRequest = array('paymentRequest' => array('authorizerId' => '1', 'autoConfirmation' => 'true', 'cardExpiryDate' => '0516', 'cardNumber' => '4000000000000044', 'cardSecurityCode' => '999', 'customerId' => '18700266', 'extraField' => 'bonus', 'installmentType' => '3', 'installments' => '1', 'nit' => $nit));
$result = $payment->doPayment($paymentRequest);
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>';
print_r($result['paymentResponse']);
echo '</pre>';
}
}
$getStatusParams = array('merchantKey' => sfConfig::get('app_esitef_merchant_key'), 'nit' => $nit);
$transactionStatus = $payment->getStatus($getStatusParams);
echo '<h2>GetStatus Result</h2><pre>';
print_r($transactionStatus);
echo '</pre>';
echo '<h2>Request</h2><pre>' . htmlspecialchars($payment->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($payment->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
die;
}
示例7: ReverseTrans
public function ReverseTrans($params)
{
$login = $params['login'];
$mainTransactionRefNum = $params['mainTransactionRefNum'];
$reverseTransactionResNum = $params['reverseTransactionResNum'];
$amount = $params['amount'];
$client = new nusoap_client('https://pna.shaparak.ir/ref-payment/jax/merchantAuth?wsdl', true);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
$params = array('context' => array('data' => array('entry' => array('key' => 'SESSION_ID', 'value' => $login))), 'reverseRequest' => array('amount' => $amount, 'mainTransactionRefNum' => $mainTransactionRefNum, 'reverseTransactionResNum' => $reverseTransactionResNum));
$result = $client->call('reverseTransaction', $params);
if ($client->fault) {
echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
//echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
}
}
return $result;
}
示例8: conf
public static function confirm۲($refrence_id)
{
$conf = new conf();
$out['err']['code'] = 8;
$out['err']['msg'] = 'UNKNOWN ERROR';
$client = new nusoap_client($conf->wurl . "server.php?wsdl", true);
$arguments = array("user" => $conf->wuser, "pass" => $conf->wpass, "refrence_id" => $refrence_id);
$result = $client->call("reserve_confirm2", $arguments);
if ($client->fault) {
$out['err']['code'] = 8;
$out['err']['msg'] = $client->fault;
echo '<hr/>';
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
} else {
$error = $client->getError();
if ($error) {
$out['err']['code'] = 8;
$out['err']['msg'] = $error;
echo '<hr/>';
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
} else {
$out = json_decode($result, TRUE);
}
}
return $out;
}
示例9: getRecordStatus
function getRecordStatus()
{
global $empwebservicequerylocation, $empwebserviceobjectsdb, $userid;
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
$client = new nusoap_client($empwebservicequerylocation, false, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
$params = array('queryParam' => array("query" => array('recordId' => $_SESSION["recordId"])), 'database' => $empwebserviceobjectsdb);
$result = $client->call('searchObjects', $params, 'http://kalio.net/empweb/engine/query/v1', '');
$resumen = $result["queryResult"]["databaseResult"]["result"]["modsCollection"]["mods"];
$vectorAbrev["id"] = $_SESSION["recordId"];
$vectorAbrev["title"] = $resumen["titleInfo"]["title"];
$vectorAbrev["publisher"] = $resumen["originInfo"]["publisher"];
$vectorAbrev["year"] = $resumen["originInfo"]["dateIssued"];
if ($resumen["extension"]["holdingsInfo"]["copies"]["copy"]["copyId"] != "") {
$vectorAbrev["copies"]["info"] = 1;
} else {
$vectorAbrev["copies"]["info"] = sizeof($resumen["extension"]["holdingsInfo"]["copies"]["copy"]);
$opciones = array();
foreach ($resumen["extension"]["holdingsInfo"]["copies"]["copy"] as $elemento) {
if ($elemento["volumeId"]) {
array_push($opciones, $elemento["volumeId"]);
}
}
//Opciones para volúmen
if (sizeof($opciones) > 0) {
$vectorAbrev["copies"]["options"] = $opciones;
}
}
$buffer = "";
// Autores heterogeneo
if ($resumen["name"]["namePart"] != "") {
$buffer = $resumen["name"]["namePart"];
} else {
for ($i = 0; $i < sizeof($resumen["name"]); $i++) {
$buffer .= $resumen["name"][$i]["namePart"] . " / ";
}
}
$vectorAbrev["authors"] = $buffer;
//Copias heterogeneas
//print_r($resumen);
if ($resumen["extension"]["holdingsInfo"]["copies"]["copy"]["copyLocation"] != "") {
$vectorAbrev["library"] = $resumen["extension"]["holdingsInfo"]["copies"]["copy"]["copyLocation"];
$vectorAbrev["objectType"][0] = $resumen["extension"]["holdingsInfo"]["copies"]["copy"]["objectCategory"];
} elseif ($resumen["extension"]["holdingsInfo"]["copies"]["copy"][0]["copyLocation"] != "") {
$vectorAbrev["library"] = $resumen["extension"]["holdingsInfo"]["copies"]["copy"][0]["copyLocation"];
$miscopias = $resumen["extension"]["holdingsInfo"]["copies"]["copy"];
$i = 0;
foreach ($miscopias as $copia) {
$vectorAbrev["objectType"][$i++] = $copia["objectCategory"];
}
}
return $vectorAbrev;
}
示例10: _connect
/**
* Initialize the SOAP client connection.
* @param String $endpoint URL to connect.
* @return Boolean True if the connection succeed.
*/
private function _connect ($endpoint, $proxyhost = null, $proxyport = null, $proxyuser = null, $proxypass = null)
{
if (is_null($proxyhost))
$proxyhost = $this->_soapProxyHost;
if (is_null($proxyport))
$proxyport = $this->_soapProxyPort;
if (is_null($proxyuser))
$proxyuser = $this->_soapProxyUser;
if (is_null($proxypass))
$proxypass = $this->_soapProxyPass;
$conn = new nusoap_client($endpoint, false, $proxyhost, $proxyport, $proxyuser, $proxypass);
$err = $conn->getError();
if ($err)
{
$this->_log->logError($err);
$this->_log->logError($conn->getDebug());
$this->_soapConn = null;
return false;
}
else
{
$conn->setUseCurl(DEFAULT_NUSOAP_CURLREQUEST);
$this->_soapConn = $conn;
return true;
}
}
示例11: array
function order_registerdomain($DomainName, $ServiceDetails, $ContactDetails)
{
//parametri dell'ordine
$params = array('LoginEmail' => $this->LoginEmail, 'LoginPassword' => $this->LoginPassword, 'DomainName' => $DomainName, 'ServiceDetails' => $ServiceDetails, 'ContactDetails' => $ContactDetails);
//Connection parameters
//do not modify - non modificare
$proxyhost = '';
$proxyport = '';
$proxyusername = '';
$proxypassword = '';
$useCURL = '0';
$client = new nusoap_client("http://api.dominiofaidate.com/xml/Order.asmx?WSDL", true);
$client->soap_defencoding = 'UTF-8';
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit;
}
$client->setUseCurl($useCURL);
$client->useHTTPPersistentConnection();
$result = $client->call('RegisterDomain', $params);
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
}
}
return $result;
}
示例12: getDebug
public function getDebug()
{
$result = null;
$class = get_parent_class($this);
switch ($class) {
case 'SoapClient':
$result = var_export(array($this->__getLastRequestHeaders(), $this->__getLastRequest(), $this->__getLastResponse(), $this->__getLastResponseHeaders()));
break;
case 'nusoap_client':
$result = parent::getDebug();
break;
default:
$result = __METHOD__;
break;
}
return $result;
}
示例13: call
/**
* Internal utility methods
*/
private function call($service, $method, $params)
{
ini_set('memory_limit', '1024M');
ini_set('max_execution_time', 1800);
set_time_limit(0);
$url = $this->wsdl_root . $service . '.asmx?wsdl';
$timeout = 3000;
$cache = new nusoap_wsdlcache($this->cache_dir, $timeout);
$wsdl = $cache->get($url);
// Set the WSDL
if (is_null($wsdl)) {
$wsdl = new wsdl($url, NULL, NULL, NULL, NULL, 0, $timeout, NULL, TRUE);
$error = $wsdl->getError();
$debug = $wsdl->getDebug();
$wsdl->clearDebug();
// Check for SOAP errors
if (!empty($error)) {
$this->errors[] = $error;
if ($debug) {
$this->errors[] = '<pre>' . print_r($debug, TRUE) . '</pre>';
}
return FALSE;
}
$cache->put($wsdl);
}
// Send the SOAP request
$params['securityPassword'] = $this->wsdl_keys[$service];
$client = new nusoap_client($wsdl, 'wsdl', FALSE, FALSE, FALSE, FALSE, 0, $timeout);
$client->setDebugLevel(0);
// 0 - 9, where 0 is off
$client->useHTTPPersistentConnection();
if ($service == 'DataAccess' && $method == 'ExecuteStoredProcedure') {
/*
* See http://www.codingforums.com/archive/index.php/t-85260.html
* and http://users.skynet.be/pascalbotte/rcx-ws-doc/nusoapadvanced.htm
* for how to thwart the "got wsdl error: phpType is struct, but value is not an array"
* error returned by nusoap when processing the response from $client->call()
*
* */
$request = $client->serializeEnvelope(vsprintf('<ExecuteStoredProcedure xmlns="http://ibridge.isgsolutions.com/%s/">
<securityPassword>%s</securityPassword>
<name>%s</name>
<parameters>%s</parameters>
</ExecuteStoredProcedure>', array($service, $params['securityPassword'], $params['name'], $params['parameters'])));
$response = $client->send($request, 'http://ibridge.isgsolutions.com/' . $service . '/' . $method, 0, $timeout);
} else {
$response = $client->call($method, $params);
}
$error = $client->getError();
$debug = $client->getDebug();
$client->clearDebug();
// Check for SOAP errors
if (!empty($error)) {
$this->errors[] = $error;
if ($debug) {
$this->errors[] = '<pre>' . print_r($debug, TRUE) . '</pre>';
}
return FALSE;
}
// Process response
$response = $response[$method . 'Result'];
$data = NULL;
if (strpos($response, '<') == 0) {
// Some ISGweb methods return strings instead of XML
libxml_use_internal_errors(TRUE);
$response = preg_replace('/(<\\?xml[^?]+?)utf-16/i', '$1utf-8', $response);
// Change encoding string to UTF8
$response = utf8_encode($response);
$response = $this->strip_invalid_xml($response);
$obj = simplexml_load_string($response);
$data = $response;
$error = libxml_get_errors();
// Check for XML parsing errors
if (!empty($error)) {
foreach ($error as $e) {
$this->errors[] = $e;
}
libxml_clear_errors();
return FALSE;
}
$data = $this->object_to_array($obj);
// Check for ISGweb errors (e.g. invalid data input, failure of service, etc.)
if (array_key_exists('Errors', $data)) {
$error = $data['Errors'];
foreach ($error as $e) {
$this->errors[] = $e['@attributes']['Description'];
}
return FALSE;
}
} else {
$data = $response;
}
return $data;
}
示例14: passengers
public static function passengers($refID, $passengers, $mobile, $email, $address, $description)
{
$conf = new conf();
$out['err']['code'] = 8;
$out['err']['msg'] = 'UNKNOWN ERROR';
$client = new nusoap_client($conf->wurl . "server.php?wsdl", true);
$arguments = array("user" => $conf->wuser, "pass" => $conf->wpass, "refrence_id" => $refID, "jpassengers" => json_encode($passengers), "mobile" => $mobile, "email" => $email, "address" => $address, "description" => $description);
$result = $client->call("reserve_passengers2", $arguments);
if ($client->fault) {
$out['err']['code'] = 8;
$out['err']['msg'] = $client->fault;
} else {
$error = $client->getError();
if ($error) {
$out['err']['code'] = 8;
$out['err']['msg'] = $error;
echo '<hr/>';
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<hr/>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
} else {
$out = json_decode($result, TRUE);
}
}
return $out;
}
示例15: htmlspecialchars
<?php
require_once 'nusoap.php';
// Crear un cliente apuntando al script del servidor (Creado con WSDL)
$serverURL = 'https://powerservice.finotex.com:441/powerservice';
$serverScript = 'n_powerservice.asmx';
$metodoALlamar = 'f_cadena';
$cliente = new nusoap_client("{$serverURL}/{$serverScript}?wsdl", 'wsdl');
$cliente->soap_defencoding = 'UTF-8';
// Se pudo conectar?
$error = $cliente->getError();
if ($error) {
echo 'sc<pre style="color: red">' . $error . '</pre>';
echo '<p style="color:red;' > htmlspecialchars($cliente->getDebug(), ENT_QUOTES) . '</p>';
die;
}
// 1. Llamar a la funcion getRespuesta del servidor
$result = $cliente->call("{$metodoALlamar}");
// Verificacion que los parametros estan ok, y si lo estan. mostrar rta.
if ($cliente->fault) {
echo '<b>Error: ';
print_r($result);
echo '</b>';
} else {
$error = $cliente->getError();
if ($error) {
echo 'cc<b style="color: red">Error: ' . $error . '</b>';
} else {
echo 'Respuesta: ' . $result['f_cadenaResult'];
}
}