WebService SOAP に接続しようとしています。このサービスでは、soap 呼び出しの HTTP ヘッダーにカスタム パラメーターを追加する必要があります。
$context = array('http' =>
array(
'header' => "APIToken: $api_token\r\n"
)
);
$soap_options = array(
'stream_context' => stream_context_create($context),
'encoding' => 'UTF-8',
'exceptions' => TRUE,
'trace' => true,
'local_cert' => 'mycert.pem',
'passphrase'=>'xxx',
'location'=>$this->url_soap_dev
);
$soap_client = new SoapClient('soap.wsdl', $soap_options);
$args = array(
'param1' => $var,
'param2' => 0,
'optionalParameters'=>array()
);
$ret = $soap_client->RemoteFunction(array('parameter'=>$args));
そして、これは私のリクエストヘッダーです:
POST /server/soap HTTP/1.1
Host: domain.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.6-1+lenny16
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 400
カスタム パラメータはどこに追加できますか?
どうも。