[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching XML for exchange rates into HTTPAPI/EXAMPLE18



Hello Mo Khan,

> I know that the program LIBHTTP/EXAMPLE18 calls the currency
> exchange rate web service provided by WebserviceX.net but rates
> does not seem consistent with other financial websites.

With all due respect, this has nothing to do with HTTPAPI.  If you think 
WebserviceX.net is posting incorrect exchange rates, then complain to 
WebserviceX.net.   HTTPAPI only retrieves them.

HTTPAPI only provides a communication mechanism.  It lets data on an 
HTTP server be copied to your system.  It doesn't know or care what that 
data is.  It has no control over whether the data on that web site is 
right or wrong.

Consider an analogy:  I'm done working for the day, so I call my wife to 
ask her what's for dinner.  She says "chicken."  I drive home, and it 
turns out, she made meatloaf instead.  Is there a problem with my 
telephone?  Should I complain to the phone company?  After all, my 
telephone told me we were having chicken, and it turned out to be 
meatloaf!!   NO.  OF COURSE NOT.   It's not the phone that's wrong.  The 
phone did what it was supposed to -- it let me communicate with my wife. 
  It's my wife's fault that she said the wrong thing.

Same is true with the exchange rates.  HTTPAPI is just copying the data 
from WebserviceX.net to your computer.  That's it's job.  It's not 
HTTPAPI's fault if that data is wrong, it's WebserviceX.net's fault!


> I read the HTTP POST and GET, and also the XML but did not find any
> link to any website e.g Forex.com or www.wallstreetjournal.com where
> they actually post the rates. Where these rates are coming from in 
> program EXAMPLE18?

They're coming from WebserviceX.net.


> On [1]http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=18,
> if a test for currency conversion is invoked (fill out
> FromCurrency/ToCurrency and hit Invoke button), it gives out an
> XML page (see
> [2]http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate>        e)
> 
> Even that does not show the actual source for exchange rates.

Again... you don't like the way webservicex.net provides exchange rates, 
don't use them.  Use something else, or complain to webservicex.net.

>     3. I am working to get exchange rates from website
>        [3]http://www.bankofcanada.ca/en/rates/exchange-look.html

Okay... that's not a web service.  That's a regular web page.


>    I modified and successfully compiled the program EXAMPLE18 with this
>    new website but getting an error when calling the EXAMPLE18
> 
>    XML parse failed at line 6, col 309: not well-formed (invalid token)

That's because the web site is returning HTML, and the parser is an XML 
parser!

That site isn't a web service.  You can try to use HTTPAPI to get the 
data if you like, but the program logic will be very different from 
what's in EXAMPLE18.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------