PHP使用SOAP客户端发送SOAP请求

PHP使用SOAP客户端发送SOAP请求,php,soap,Php,Soap,这是我第一次使用SOAP,我已经阅读了所有手册,仍然使用以下示例: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSch

这是我第一次使用SOAP,我已经阅读了所有手册,仍然使用以下示例:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"   
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Header>
    <AuthenticationInfo xmlns="https://blabla.com/ws/Quoting">
      <strUserName>[username]</strUserName>
       <strPassword>[password]</strPassword>
   </AuthenticationInfo>
 </soap:Header>
 <soap:Body>
    <GetQuotes xmlns="https://blabla.com/ws/Quoting">
      <CallerClientID>0</CallerClientID>
          <quoteRequest>
            <CapacityCode>2</CapacityCode>
           <BabiesCount>0</BabiesCount>
           <QuotingOptions>0</QuotingOptions>
         </quoteRequest>
      <clientIDs>
        <int>20295</int>
      </clientIDs>
      <withUrlParam>false</withUrlParam>
    </GetQuotes>
  </soap:Body>
</soap:Envelope>

[用户名]
[密码]
0
2.
0
0
20295
假的

我不知道如何使用授权启动soapclient,请帮助。

您需要使用
SoapHeader
。下面是一个例子

$ns = 'https://blabla.com/ws/Quoting'; //Namespace of the WS. 

//Body of the Soap Header. 
$headerbody = array('strUserName' => $someUser, 
                    'strPassword' => $somePass); 

//Create Soap Header.        
$header = new SOAPHeader($ns, 'AuthenticationInfo', $headerbody);        

//set the Headers of Soap Client. 
$soap_client->__setSoapHeaders($header); 

您需要使用
SoapHeader
。下面是一个例子

$ns = 'https://blabla.com/ws/Quoting'; //Namespace of the WS. 

//Body of the Soap Header. 
$headerbody = array('strUserName' => $someUser, 
                    'strPassword' => $somePass); 

//Create Soap Header.        
$header = new SOAPHeader($ns, 'AuthenticationInfo', $headerbody);        

//set the Headers of Soap Client. 
$soap_client->__setSoapHeaders($header); 

告诉我怎么做,我是纽贝这里)左边一个绿色的V?告诉我怎么做,我是纽贝这里)左边一个绿色的V?