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


PHP Zend_Soap_Client::setUri方法代码示例

本文整理汇总了PHP中Zend_Soap_Client::setUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Soap_Client::setUri方法的具体用法?PHP Zend_Soap_Client::setUri怎么用?PHP Zend_Soap_Client::setUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Soap_Client的用法示例。


在下文中一共展示了Zend_Soap_Client::setUri方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SendRequestToInternal

 /**
  * send http request to internal RPC and return response string.
  * 
  * @return string
  */
 public function SendRequestToInternal(Np_Method $request)
 {
     Application_Model_General::virtualSleep();
     // used to write to log to be in order
     $data = $this->createPostData($request);
     $url = Application_Model_General::getSettings('UrlToInternalResponse');
     $auth = Application_Model_General::getSettings('InternalAuth');
     $method = self::getMethodName($this->params['MSG_TYPE']);
     if ($this->protocal == 'http') {
         $client = new Zend_Http_Client();
         $client->setUri($url);
         $client->setParameterGet('method', $method);
         if (is_numeric($timeout = Application_Model_General::getSettings('InternalAuth'))) {
             $client->setConfig(array('timeout' => $timeout));
         }
         $client->setParameterPost($data);
         if (isset($auth['user'])) {
             $user = (string) $auth['user'];
             if (isset($auth['password'])) {
                 $password = (string) $auth['password'];
                 $client->setAuth($user, $password);
             }
             $client->setAuth($user);
         }
         $logContentRequest = "Send to internal " . PHP_EOL . print_R(array_merge(array('method' => $method), $data), 1) . PHP_EOL;
         Application_Model_General::logRequest($logContentRequest, $data['reqId']);
         $client->setMethod(Zend_Http_Client::POST);
         $response = $client->request();
         $ret = $response->getBody();
         $logContentResponse = "Response from internal " . PHP_EOL . $ret . PHP_EOL . PHP_EOL . PHP_EOL;
         Application_Model_General::logRequest($logContentResponse, $data['reqId']);
     } elseif ($this->protocal == 'soap') {
         $client = new Zend_Soap_Client();
         $client->setUri($url);
         $ret = call_user_func_array(array($client, $method), $data);
     }
     return $ret;
 }
开发者ID:carriercomm,项目名称:NPG,代码行数:43,代码来源:Internal.php


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