Php 尝试SOAP调用时,对象引用未设置为对象错误的实例

Php 尝试SOAP调用时,对象引用未设置为对象错误的实例,php,soap,wsdl,Php,Soap,Wsdl,我正在尝试使用SOAP/wsdl连接到Web服务并进行身份验证,但我经常遇到错误: <b>Fatal error</b>: Uncaught SoapFault exception: [a:InternalServiceFault] Object reference not set to an instance of an object. in /path/install.php:16 这给了我一个关于LogOnType不受支持的错误(用丹麦语,这对我来说意味着至少我

我正在尝试使用SOAP/wsdl连接到Web服务并进行身份验证,但我经常遇到错误:

<b>Fatal error</b>:  Uncaught SoapFault exception: [a:InternalServiceFault] Object reference not set to an instance of an object. in /path/install.php:16
这给了我一个关于
LogOnType
不受支持的错误(用丹麦语,这对我来说意味着至少我现在已经与服务器建立了某种连接)。用户名和密码数组无效,我可以替换一个空字符串并得到相同的结果,不同之处在于小写的
logon

如果有人能建立一个工作示例,给出错误的
不正确的用户名或密码
我将永远感激。。。但是任何指针都将非常受欢迎


据我所知,wsdl提供了实现这一点所需的所有信息,我只是一个太多的
[你的选择]
,无法得到它…?

难以置信!写这16行代码只花了9个小时

<?php
header("Content-Type: text/plain"); 

$userinfo = array(
    'Username'=>'test',
    'Password'=>'test'
);

$wsdl_url = 'https://ws-e-distribution.kmd.dk/standard/ServiceAutorisation/ServiceAutorisation.svc?wsdl';
$client = new SoapClient($wsdl_url, array('trace' => 1, "exception" => 0));

print_r($client->__getFunctions());
print_r($client->__getTypes());

//This actually works ! :) :) :)
$response = $client->LogOn(array('logon' => new SoapVar($userinfo, SOAP_ENC_OBJECT, 'LogOnUsername', 'http://schemas.datacontract.org/2004/07/WebServiceAutorisation.BL')));

var_dump($response);

$response = $client->LogOn(array('logon' => array('Username' => 'test','Password' => 'test')));
<?php
header("Content-Type: text/plain"); 

$userinfo = array(
    'Username'=>'test',
    'Password'=>'test'
);

$wsdl_url = 'https://ws-e-distribution.kmd.dk/standard/ServiceAutorisation/ServiceAutorisation.svc?wsdl';
$client = new SoapClient($wsdl_url, array('trace' => 1, "exception" => 0));

print_r($client->__getFunctions());
print_r($client->__getTypes());

//This actually works ! :) :) :)
$response = $client->LogOn(array('logon' => new SoapVar($userinfo, SOAP_ENC_OBJECT, 'LogOnUsername', 'http://schemas.datacontract.org/2004/07/WebServiceAutorisation.BL')));

var_dump($response);