当前位置: 首页>>代码示例>>PHP>>正文


PHP soap_transport_http::get_error方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:lanma121,项目名称:superPrize,代码行数:83,代码来源:nusoap.class.php


注:本文中的soap_transport_http::get_error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。