以下代码在 SoapUI 中工作:
https://webserver.domain.com/Service?server=webserver-prod&webService=WS_Create_Incident
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WS_Create_Incident">
<soapenv:Header>
<urn:AuthenticationInfo>
<urn:userName>username@domain.com</urn:userName>
<urn:password>Scrambled</urn:password>
</urn:AuthenticationInfo>
</soapenv:Header>
<soapenv:Body>
<urn:HelpDesk_Submit_Service>
<urn:Assigned_Group>GROUP</urn:Assigned_Group>
<urn:Assigned_Support_Company>COMPANY</urn:Assigned_Support_Company>
<urn:Assigned_Support_Organization>ORGANIZATION</urn:Assigned_Support_Organization>
</urn:HelpDesk_Submit_Service>
</soapenv:Body>
</soapenv:Envelope>
我已经在我的测试 php 服务器上安装了 soap 扩展。如何使用 php 发出此请求?
尝试在 PHP 手册中查找 SOAP 示例:http://php.net/manual/en/book.soap.php
$client = new SoapClient('http://www....com/.../?WSDL');
$client->__getFunctions();
$client->__getTypes();