php設定SoapHeader

789 ワード

  php   soapHeader      ,            “user23107720”   :

 $auth_header = array( 'user'=>$key, 'password'=>$pwd );
 //    RequestSOAPHeader    wsdl       name="RequestSOAPHeader">.....	
$authvalues = new SoapVar($auth_header, SOAP_ENC_OBJECT,"RequestSOAPHeader",$uri);  
$header = new SoapHeader($uri, 'RequestSOAPHeader', $authvalues);
$api = new SoapClient(null,$options);
$api->__setSoapHeaders(array($header));