Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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
php与soap服务_Php_Xml_Soap - Fatal编程技术网

php与soap服务

php与soap服务,php,xml,soap,Php,Xml,Soap,我需要使用此xml文件: 要连接到GetTopGainers方法 我使用以下代码: <?php ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache $wsdl_path = "http://www.mubashermisr.com/Mubadelayed/Service1.asmx?WSDL"; $parameters = array("Username"=>"xxxx"

我需要使用此xml文件:

要连接到GetTopGainers方法 我使用以下代码:

    <?php
    ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
    $wsdl_path = "http://www.mubashermisr.com/Mubadelayed/Service1.asmx?WSDL";

    $parameters = array("Username"=>"xxxx","Password"=>"xxxx","ID"=>"xxxxx");

    $client = new SoapClient($wsdl_path, array('trace' => 1));

    try {
    $result = $client->GetTopGainers($parameters);
    print_r($result);
   }
    catch (SoapFault $exception) {
    echo $exception;      
    } 

   ?>
任何帮助都将不胜感激。 谢谢




以下是eroor:SoapFault异常:[soap:Server]服务器无法处理请求。-->对象引用未设置为对象的实例。在C:\wamp\www\soap\soap.php:24堆栈跟踪中:#0 C:\wamp\www\soap\soap.php(24):SoapClient->u调用('GetTopGainers',Array)#1c:\wamp\www\soap\soap.php(24):SoapClient->GetTopGainers(Array)#2{main}这里是eroor:SoapFault异常:[soap:Server]服务器无法处理请求。-->>对象引用未设置为对象的实例。在C:\wamp\www\soap\soap.php:24堆栈跟踪中:#0 C:\wamp\www\soap\soap.php(24):SoapClient->u调用('GetTopGainers',Array)#1c:\wamp\www\soap\soap.php(24):SoapClient->GetTopGainers(Array)#2{main}
SoapFault exception: [soap:Server] Server was unable to process request.
     ---> Object reference not set to an instance of an object. in 
C:\wamp\www\soap\soap.php:24 Stack trace: #0 
C:\wamp\www\soap\soap.php(24): SoapClient->__call('GetTopGainers', Array) 
#1 C:\wamp\www\soap\soap.php(24): SoapClient->GetTopGainers(Array) #2 
{main}
    <?php
    ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
    $wsdl_path = "URL";

    $parameters = array("Username"=>"xxx","Password"=>"xxx","ID"=>"xxx");

   $header = new SOAPHeader('Namespace', 'Auth', $parameters);
   $client = new SoapClient($wsdl_path);

   $client->__setSoapHeaders($header);
   try {
    $topGainers = $client->GetTopGainers(); // Top Gainers

    echo"<pre>";
    print_r($topGainers);
    echo"</pre>";
    }
    catch (SoapFault $exception) {
    echo $exception;      
    } 

    ?>