我正试图提出一个简单的请求。它在SoapUI中工作,现在正试图转移到php。
SoapUI生成的信封(此项工作):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:HPD_IncidentInterface_WS">
<soapenv:Header>
<urn:AuthenticationInfo>
<urn:userName>USERNAME</urn:userName>
<urn:password>PASSWORD</urn:password>
<!--Optional:-->
<urn:authentication>?</urn:authentication>
<!--Optional:-->
<urn:locale>?</urn:locale>
<!--Optional:-->
<urn:timeZone>?</urn:timeZone>
</urn:AuthenticationInfo>
</soapenv:Header>
<soapenv:Body>
<urn:HelpDesk_QueryList_Service>
<urn:Qualification></urn:Qualification>
<urn:startRecord></urn:startRecord>
<urn:maxLimit>10</urn:maxLimit>
</urn:HelpDesk_QueryList_Service>
</soapenv:Body>
</soapenv:Envelope>
php:(我可以运行$fcs=$client->__getFunctions();并获取函数,但$result函数不会运行。无错误消息)
$client = new SoapClient($url,array("userName" => $username, "password" => $password));
$result = $client->HelpDesk_QueryList_Service(array('Qualification' => '', 'startRecord' => '','maxLimit' => '10'));
进行了更多的搜索和测试,并获得了连接的编写代码。
$client = new SoapClient($url);
$headerbody = array('userName' => $username,
'password' => $password,
'authentication'=>'',
'locale'=>'',
'timeZone'=>'');
$header = new SOAPHeader($ns, 'AuthenticationInfo', $headerbody);
$client->__setSoapHeaders($header)