简体   繁体   中英

Soap Error: Object reference not set to an instance of an object

I am getting this error:

stdClass Object ( [GetAllEntitiesResult] => Object reference not set to an instance of an object. )

$wsdl = "http://192.168.25.10:200/FXOWS.asmx?WSDL";    
$username="xxxx";    
$password="xxxxx";    
$orgid="x";    
$client = new SoapClient($wsdl);     
$token_ob = $client->GetAllEntities(array('userName'=>$username, 'passWord' =>$password,'OrgID' =>$orgid));    
print_r($token_ob);
?>

Here is an snippet code that i use for SOAP, you have to adapt it for your need :

$params = array('userName' => $username,
                'passWord' => $password,
                'OrgID'    => $orgid,
          ));

$wsdl = "http://192.168.25.10:200/FXOWS.asmx?WSDL";

$options = array(
        'uri'=>'http://schemas.xmlsoap.org/soap/envelope/',
        'style'=>SOAP_RPC,
        'use'=>SOAP_ENCODED,
        'soap_version'=>SOAP_1_1, // depends of your version
        'cache_wsdl'=>WSDL_CACHE_NONE,
        'connection_timeout'=>15,
        'trace'=>true,
        'encoding'=>'UTF-8',
        'exceptions'=>true,
        );

    $soap = new SoapClient($wsdl, $options);
    $token_ob = $soap->GetAllEntities($params);

    var_dump($token_ob);

Tell me what result do you have.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM