对象引用未设置为https soap调用上的对象实例

时间:2015-07-01 22:32:20

标签: php soap wsdl

尝试使用HTTPS进行SOAP调用时出现以下错误。

以下是代码。我尝试了不同的方法,没有运气。

链接是http://dev.jp-websolutions.co.uk/teletrac/getsafetydata/test 我看到的错误是SoapFault exception: [soap:Receiver] Server was unable to process request. ---> Object reference not set to an instance of an object

这就是我现在正在使用的。

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


$params = array(
    "UserName" => "xxx",
    "Password" => "xxx",

);
$opts = array(
    'ssl' => array('ciphers'=>'RC4-SHA')
);
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("https://onlineavl2dev-uk.navmanwireless.com/OnlineAVL/API/v1.3/Service.asmx?wsdl",  array('trace' => 1, 'soap_version' => SOAP_1_2, "encoding"=>"ISO-8859-1",
'stream_context' => stream_context_create($opts)));
#print_r($client); die;
#$response = $client->DoLogin($params);

//print_r($client->__getFunctions());
//print_r($client->__getTypes());
try {
    echo "<pre>\n";
    $result = $client->DoLogin(array(
        "UserName" => "xxx",
        "Password" => "xxx",
    ));
    print_r($result);
    echo "\n";
}
catch (SoapFault $exception) {
    echo $exception;      
} 
print_r($response); die;

0 个答案:

没有答案