简体   繁体   中英

Web service using SOAP, WSDL not working - PHP

I am trying to gain access to a 'free' web service which publishes London Gold and Silver Fixes.

I have found the following two services, but I am unable to get the services to return any useful data.

Am I doing something wrong or is the server not publishing any data? Does anybody know of any other 'free' London Gold & Silver Fix servers which work?

CLIENT CODE:

<pre>
<?php
$c = new soapclient('http://www.restfulwebservices.net/wcf/LondonGoldFixService.svc?wsdl');
print_r($c->GetMarketData());
?>
</pre>
<br />

<pre>
<?php
$c = new soapclient('http://www.webservicex.net/londongoldfix.asmx?wsdl');
print_r($c->GetLondonGoldAndSilverFix());
?>
</pre>

SERVER OUTPUT:

    stdClass Object
    (
    [GetMarketDataResult] => stdClass Object
        (
            [Gold_AM_USD] => 0
            [Gold_AM_STG] => 0
            [Gold_AM_EUR] => 0
            [Gold_PM_USD] => 0
            [Gold_PM_STG] => 0
            [Gold_PM_EUR] => 0
            [Silver_CENTS] => 0
            [Silver_PENCE] => 0
            [Silver_EUR] => 0
            [Status] => Failed
        )
)

stdClass Object
(
    [GetLondonGoldAndSilverFixResult] => stdClass Object
        (
            [Gold_AM_USD] => 0
            [Gold_AM_STG] => 0
            [Gold_AM_EUR] => 0
            [Gold_PM_USD] => 0
            [Gold_PM_STG] => 0
            [Gold_PM_EUR] => 0
            [Silver_CENTS] => 0
            [Silver_PENCE] => 0
            [Silver_EUR] => 0
            [Status] => Failed
        )

)

It looks like the server is returning data. It's all zero. Your soap code is working. The website must be returning bad data or be broken.

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