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


PHP soapclient::__setSoapHeaders方法代码示例

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


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

示例1: sample_code_get_jsonAction

 public function sample_code_get_jsonAction(Request $request)
 {
     // define the SOAP client using the url for the service
     $client = new soapclient('http://globalmetals.xignite.com/xGlobalMetals.asmx?WSDL');
     // create an array of parameters
     $param = array();
     // add authentication info
     $xignite_header = new SoapHeader('http://www.xignite.com/services/', "Header", array("Username" => "5E7B30B762CD4E0B9F317540D6E44427"));
     $client->__setSoapHeaders(array($xignite_header));
     // call the service, passing the parameters and the name of the operation
     $result = $client->ListMetals($param);
     // assess the results
     if (is_soap_fault($result)) {
         //echo '<h2>Fault</h2><pre>';
         //print_r($result);
         // echo '</pre>';
     } else {
         // echo '<h2>Result</h2><pre>';
         print_r($result);
         // echo '</pre>';
     }
     // print the SOAP request
     //echo '<h2>Request</h2><pre>' . htmlspecialchars($client->__getLastRequest(), ENT_QUOTES) . '</pre>';
     // print the SOAP request Headers
     //echo '<h2>Request Headers</h2><pre>' . htmlspecialchars($client->__getLastRequestHeaders(), ENT_QUOTES) . '</pre>';
     // print the SOAP response
     //echo '<h2>Response</h2><pre>' . htmlspecialchars($client->__getLastResponse(), ENT_QUOTES) . '</pre>';
     return true;
 }
开发者ID:usharanimoturi,项目名称:goldtask,代码行数:29,代码来源:ClockinController.php

示例2: serialize

 $log->Duracion = $result->Resultado->Duracion;
 $log->FechaHoraInicio = $result->Resultado->FechaHoraInicio;
 $log->MaxDuracion = $result->Resultado->MaxDuracion;
 $log->Observaciones = $result->Resultado->Observaciones;
 $log->Calificacion = $result->Resultado->Calificacion;
 $log->URLVerResultados = $result->Resultado->URLVerResultados;
 add_to_log(3, 12, serialize(addslashes_object($log)));
 /// save log registering the number of details
 add_to_log(3, 13, serialize(count($result->Detalles)));
 $params = new ResultadoDetalleExtendido();
 $params->ResultadoExtendido = new SoapVar($result, SOAP_ENC_OBJECT, "SeguimientoExtendido", "http://educacio.gencat.cat/agora/seguimiento/");
 $client = new soapclient($reg_session->wsurltracking . '?wsdl', array('trace' => 1));
 $auth = array('User' => $reg_credential->username, 'Password' => $reg_credential->password);
 $namespace = rcommond_wdsl_parser($reg_session->wsurltracking . '?wsdl');
 $header = new SoapHeader($namespace, "WSEAuthenticateHeader", $auth);
 $client->__setSoapHeaders(array($header));
 /// save log registering the call to ws tracking
 add_to_log(3, 14);
 try {
     $response = $client->__soapCall("ResultadoDetalleExtendido", array($params));
 } catch (Exception $e) {
     print_r($e);
 }
 //delete session information
 if ($response->ResultadoDetalleExtendidoResult->Resultado == 'OK') {
     // XTEC *********** DELETED -> Take out the session delletion to keep it in hierarchical books
     // 2011.09.02 @mmartinez
     //delete_records("sessions", 'token', $token);
     // ********** FI
     echo "OK";
 } else {
开发者ID:jperezpamos,项目名称:marsupial-mps,代码行数:31,代码来源:wsTracking.php


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