无法弄清楚如何在PHP中创建XML SOAP Post
我搜索了更多示例,但它不起作用。我不知道如何为我的xml消息创建一段“POST代码”。我想我需要一个soapclient,但我不完全知道我如何使用它。无法弄清楚如何在PHP中创建XML SOAP Post
WSDL文件地址:https://secure.intelly.nl/webservices/intellymodule001.asmx?WSDL
这是我创建的XML消息:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://extranet.intelly.nl/module001/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<SOAP-ENV:Body>
<tns:GetDomains xmlns:tns="http://extranet.intelly.nl/module001/">
<tns:credentials>
<ExternalProgramFunction>***</ExternalProgramFunction>
<ExternalProgramID>***</ExternalProgramID>
<Domain>***</Domain>
<Username>***</Username>
<Password>***</Password>
</tns:credentials>
<tns:message>
</tns:message>
<tns:message>
</tns:message>
<tns:searchParameters>
<OnlyActive>True</OnlyActive>
</tns:searchParameters>
</tns:GetDomains>
</SOAP-ENV:Body>
回答:
PHP有一个本地SoapClient,下面是一个例子使用输入结构:
$client = new SoapClient('https://secure.intelly.nl/webservices/intellymodule001.asmx?WSDL'); $params = array(
'credentials' => array(
'ExternalProgramFunction' => 'xxx',
'ExternalProgramID' => 'xxx',
'Domain' => 'xxx',
'UserName' => 'xxx',
'Password' => 'xxx'
),
'message' => array(),
'searchParameters' => array(
'OnlyActive' => true
)
);
$response = $client->GetDomains($params);
print_r($response);
以上是 无法弄清楚如何在PHP中创建XML SOAP Post 的全部内容, 来源链接: utcz.com/qa/263792.html