Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';我不知道如何在PHP中创建XML SOAP Post_Php_Xml_Web Services_Soap_Wsdl - Fatal编程技术网

Can';我不知道如何在PHP中创建XML SOAP Post

Can';我不知道如何在PHP中创建XML SOAP Post,php,xml,web-services,soap,wsdl,Php,Xml,Web Services,Soap,Wsdl,我搜索了很多例子,但都没用。我不知道如何为我的xml消息创建一段“POST代码”。我想我需要一个soapclient,但我不知道如何使用它 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:so

我搜索了很多例子,但都没用。我不知道如何为我的xml消息创建一段“POST代码”。我想我需要一个soapclient,但我不知道如何使用它

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有一个本机,下面是一个使用输入结构的示例:

$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);

好的,谢谢你的例子!但是如果我使用它,响应是:stdClass对象([GetDomainsResult]=>stdClass对象()[message]=>stdClass对象([Information]=>stdClass对象()[Warnings]=>stdClass对象()[Errors]=>stdClass对象([string]=>Specify username)[ErrorCode]=>)所以出于某种原因,它不会得到我填写的用户名。。。(当然,我用好的值替换了所有的x)有什么想法吗?哦,对不起。它起作用了!!谢谢