SOAP 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程

SoapClient->__setSoapHeaders

(No version information available, might be only in CVS)

SoapClient->__setSoapHeaders Sets SOAP headers for subsequent calls.

说明

SoapClient
bool __setSoapHeaders ([ mixed $headers ] )

Defines headers to be sent along with the SOAP requests.

Note: Calling this method will replace any previous values.

参数

headers

The headers to be set. If not specified, the headers will be deleted.

返回值

如果成功则返回 TRUE,失败则返回 FALSE

范例

Example #1 Set A Single Header

<?php

$client 
= new SoapClient(null, array('location' => "http://localhost/soap.php",
                                     
'uri'      => "http://test-uri/"));
$header = new SoapHeader('http://soapinterop.org/echoheader/'
                            
'echoMeStringRequest',
                            
'hello world'));

$client->__setSoapHeaders($header);

$client->__soapCall("echoVoid"null);
?>

Example #2 Set Multiple Headers

<?php

$client 
= new SoapClient(null, array('location' => "http://localhost/soap.php",
                                     
'uri'      => "http://test-uri/"));
$headers = array();

$headers[] = new SoapHeader('http://soapinterop.org/echoheader/'
                            
'echoMeStringRequest',
                            
'hello world'));

$headers[] = new SoapHeader('http://soapinterop.org/echoheader/'
                            
'echoMeStringRequest',
                            
'hello world again'));

$client->__setSoapHeaders($headers);

$client->__soapCall("echoVoid"null);
?>


SOAP 函数
php 手册 | 脚本学堂 | 脚本编程 | 网站编程 | 系统管理 | 服务器配置 | 数据库管理 | Php教程 | python教程 | 正则表达式 | 批处理脚本 | Centos教程 | Linux基础教程