-2

i try to fetch result from www.tadawul.com.sa with php soap client.

but when i try to load that , get nothing just loading page.

here is my code.

$reference = array(
             'companyId' => '*********',
             'secureKey' => '*********'
        );

        $client = new SoapClient('http://www.tadawul.com.sa/Tadawul_WebAPI/services/GetDetailQuote?wsdl');
        $response = $client->getDetailQuoteForCompany($reference);
        var_dump($response);
  • 1
    Did you look at your error logs? Add [error reporting](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php/845025#845025) to the top of your file(s) _while testing_ right after your opening PHP tag for example ` – RiggsFolly May 21 '16 at 16:31
  • it didn't show any error. here is my live link http://spimaco.com.sa/ – Muhammad Alsahelsolutel May 22 '16 at 07:42
  • I GET THIS ERROR A PHP Error was encountered Severity: Warning Message: SoapClient::SoapClient(): SSL: Connection reset by peer Filename: libraries/Stock.php Line Number: 46 – Muhammad Alsahelsolutel May 22 '16 at 09:08
  • Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.tadawul.com.sa/Tadawul_WebAPI/services/GetDetailQuote?wsdl' : StartTag: invalid element name in /home/--------/Stock.php:46 Stack trace: #0 /home/----------------/Stock.php(46): SoapClient->SoapClient('http://www.tada...') #1 /home/---------homepage.php(33): – Muhammad Alsahelsolutel May 22 '16 at 09:08
  • Stock->showStocks() #2 [internal function]: Homepage->index() #3 /home/-----/CodeIgniter.php(359): call_user_func_array(Array, Array) #4 /home/----------/index.php(203): require_once('/home/spimacoco...') #5 {main} thrown in /home/-------/Stock.php on line 46 – Muhammad Alsahelsolutel May 22 '16 at 09:08

2 Answers2

0

I think the problem is in the structure you need to pass a getDetailQuoteForCompanyRequest Object not an array Why don't you use wsdl2phpgenerator

It'll make you life easier, You need to pass wsdl file and it will generate all the classes that you need

angel.bonev
  • 2,154
  • 3
  • 20
  • 30
0

Instead of this

$response = $client->getDetailQuoteForCompany($reference);

Try

$response = $client->__soapCall("getDetailQuoteForCompany", array($reference));
  • i try your code but getting same issue. let me show you live url – Muhammad Alsahelsolutel May 22 '16 at 07:41
  • if by now you where unable to fix this please take a look in this post https://groups.google.com/forum/embed/#!topic/google-doubleclick-for-publishers-api/nely_4Vl_No maybe it will be helpful. @MuhammadAlsahelsolutel –  May 22 '16 at 19:00