我正在尝试访问
上的HelloWorldCredentials服务 https://statistik.uni-c.dk/instregws/DataServiceXML.asmx?op=HelloWorldCredentials
我有必要的证件。
据我所知,我需要提交一个名为“Credentials”的数组,其中包含一个包含两个字符串的数组,一个名为“Username”,另一个名为“Password”。
我像这样构建我的数组:
$params = array(
"Credentials" => array(
"Username" => "Obviously",
"Password" => "NotPublic",
)
);
然而,当我执行
时$client = new SoapClient("https://statistik.uni-c.dk/instregws/DataServiceXML.asmx?wsdl", array('trace' => 1));
$params = array(
"Credentials" => array(
"Username" => "Obviously",
"Password" => "NotPublic",
)
);
$response = $client->__soapCall("HelloWorldCredentials", array($params));
echo("*** PARAMS ***\n");
var_dump( $params );
echo("\n*** REQUEST ***\n");
echo( $client->__getLastRequest() );
echo("\n*** RESPONSE ***\n");
var_dump( $response );
我得到了
*** PARAMS ***
array(1) {
["Credentials"]=>
array(2) {
["Username"]=>
string(11) "Obviously"
["Password"]=>
string(8) "NotPublic"
}
}
- 我应该,但是
*** REQUEST ***
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://statistik.uni-c.dk/instreg/">
<SOAP-ENV:Body>
<ns1:HelloWorldCredentials/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
显然我得到了
*** RESPONSE ***
object(stdClass)#3 (1) {
["HelloWorldCredentialsResult"]=>
string(19) "Missing credentials"
}
为什么请求中完全没有我的参数?
答案 0 :(得分:1)