本文整理匯總了PHP中soap_transport_http::get_error方法的典型用法代碼示例。如果您正苦於以下問題:PHP soap_transport_http::get_error方法的具體用法?PHP soap_transport_http::get_error怎麽用?PHP soap_transport_http::get_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類soap_transport_http
的用法示例。
在下文中一共展示了soap_transport_http::get_error方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: send
/**
* send the SOAP message
*
* Note: if the operation has multiple return values
* the return value of this method will be an array
* of those values.
*
* @param string $msg a SOAPx4 soapmsg object
* @param string $soapaction SOAPAction value
* @param integer $timeout set connection timeout in seconds
* @param integer $response_timeout set response timeout in seconds
* @return mixed native PHP types.
* @access private
*/
function send($msg, $soapaction = '', $timeout = 0, $response_timeout = 30)
{
$this->checkCookies();
// detect transport
switch (true) {
// http(s)
case preg_match('/^http/', $this->endpoint):
$this->debug('transporting via HTTP');
if ($this->persistentConnection == true && is_object($this->persistentConnection)) {
$http =& $this->persistentConnection;
} else {
$http = new soap_transport_http($this->endpoint, $this->curl_options, $this->use_curl);
if ($this->persistentConnection) {
$http->usePersistentConnection();
}
}
$http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
$http->setSOAPAction($soapaction);
if ($this->proxyhost && $this->proxyport) {
$http->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
}
if ($this->authtype != '') {
$http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
}
if ($this->http_encoding != '') {
$http->setEncoding($this->http_encoding);
}
$this->debug('sending message, length=' . strlen($msg));
if (preg_match('/^http:/', $this->endpoint)) {
//if(strpos($this->endpoint,'http:')){
$this->responseData = $http->send($msg, $timeout, $response_timeout, $this->cookies);
} elseif (preg_match('/^https/', $this->endpoint)) {
//} elseif(strpos($this->endpoint,'https:')){
//if(phpversion() == '4.3.0-dev'){
//$response = $http->send($msg,$timeout,$response_timeout);
//$this->request = $http->outgoing_payload;
//$this->response = $http->incoming_payload;
//} else
$this->responseData = $http->sendHTTPS($msg, $timeout, $response_timeout, $this->cookies);
} else {
$this->set_error('no http/s in endpoint url');
}
$this->request = $http->outgoing_payload;
$this->response = $http->incoming_payload;
$this->appendDebug($http->getDebug());
$this->UpdateCookies($http->incoming_cookies);
// save transport object if using persistent connections
if ($this->persistentConnection) {
$http->clearDebug();
if (!is_object($this->persistentConnection)) {
$this->persistentConnection = $http;
}
}
if ($err = $http->get_error()) {
$this->set_error('HTTP Error: ' . $err);
return false;
} elseif ($this->get_error()) {
return false;
} else {
$this->debug('got response, length=' . strlen($this->responseData) . ' type=' . $http->incoming_headers['content-type']);
return $this->parseResponse($http->incoming_headers, $this->responseData);
}
break;
default:
$this->set_error('no transport found, or selected transport is not yet supported!');
return false;
break;
}
}