|
-
Dec 8th, 2004, 03:44 PM
#1
Thread Starter
Addicted Member
Where can I get real time exchange rates? [resolved]
Hey there
I'm building a web app that needs a currency converter, and at the moment all I can think of is getting hold of real time exchange rates and then doing the math from there. Is this the best way of doing it? I will be storing only one currency in the database. How can I get hold of these exchange rates? I've heard theres a web service out there that supplies them, but i'm not sure where that is.
Any help will be much appreciated!
Thanks
Last edited by Patch21; Dec 9th, 2004 at 08:03 AM.
-
Dec 9th, 2004, 06:29 AM
#2
Hyperactive Member
Re: Where can I get real time exchange rates?
http://www.cloanto.com/currencyserver/
I searched on google for this so no idea what its like but im guessing its the sort of thing you are after
-
Dec 9th, 2004, 08:02 AM
#3
Thread Starter
Addicted Member
Re: Where can I get real time exchange rates?
cool thanks
I found that web service I mentioned. You can give it two countries and it returns the up-to-date exchange rate. Quite neat.
Here it is if anyone is curious:
http://www.xmethods.net/sd/2001/Curr...geService.wsdl
-
Dec 9th, 2004, 10:59 AM
#4
Hyperactive Member
Re: Where can I get real time exchange rates? [resolved]
No worries. I may actually need this for my site.
As I haven't used web-services before/yet - do you think you could post a code example please?
-
Dec 9th, 2004, 07:15 PM
#5
Thread Starter
Addicted Member
Re: Where can I get real time exchange rates? [resolved]
All you gotta do is add the web reference to your solution (Project --> Add Web Reference...). Search for the web service and select add reference.
The function I'm using at the moment is this:
Code:
Public Function getERate(ByVal country1 As String, ByVal country2 As String) As Single
Dim CEService As net.xmethods.www.CurrencyExchangeService
Dim sngCurr As Single
If (Not country1 = String.Empty) And (Not country2 = String.Empty) Then
'instantiate web service
CEService = New net.xmethods.www.CurrencyExchangeService
Try
'get the e-rate from web service
sngCurr = CEService.getRate(country1, country2)
Return sngCurr
Catch ex As Exception
Return Nothing
End Try
End If
Return Nothing
End Function
-
Dec 11th, 2004, 04:22 AM
#6
Hyperactive Member
Re: Where can I get real time exchange rates? [resolved]
Thats great, thanks v.much
-
Dec 20th, 2005, 04:49 AM
#7
Hyperactive Member
Re: Where can I get real time exchange rates? [resolved]
 Originally Posted by Patch21
All you gotta do is add the web reference to your solution (Project --> Add Web Reference...). Search for the web service and select add reference.
The function I'm using at the moment is this:
Code:
Public Function getERate(ByVal country1 As String, ByVal country2 As String) As Single
Dim CEService As net.xmethods.www.CurrencyExchangeService
Dim sngCurr As Single
If (Not country1 = String.Empty) And (Not country2 = String.Empty) Then
'instantiate web service
CEService = New net.xmethods.www.CurrencyExchangeService
Try
'get the e-rate from web service
sngCurr = CEService.getRate(country1, country2)
Return sngCurr
Catch ex As Exception
Return Nothing
End Try
End If
Return Nothing
End Function
this seems cool, i got error on those bold word and it say not defined? anyone can help or got other better currency converter codings?
-
Dec 20th, 2005, 05:05 AM
#8
Re: Where can I get real time exchange rates? [resolved]
net.xmethods.www.CurrencyExchangeService is a ref to a webservice.
Look at post #3, #4 and #5 in this thread.
You also may want to look up how to use webservices oin the web.
Woka
-
Dec 20th, 2005, 07:48 AM
#9
Hyperactive Member
Re: Where can I get real time exchange rates? [resolved]
 Originally Posted by Wokawidget
net.xmethods. www.CurrencyExchangeService is a ref to a webservice.
Look at post #3, #4 and #5 in this thread.
You also may want to look up how to use webservices oin the web.
Woka
I already follow but got that error. the Web ref name should be what? I keep changing and it now give me this Type expected message.
-
Dec 20th, 2005, 08:55 AM
#10
Re: Where can I get real time exchange rates? [resolved]
When u setup a web service in your app you assign it a "Web Reference Name", this is what u use to asses the web service, ie if I called it Woof then I would do:
VB Code:
Dim MyWebService As new Woof
Woka
-
Dec 20th, 2005, 09:49 AM
#11
Hyperactive Member
Re: Where can I get real time exchange rates? [resolved]
 Originally Posted by Wokawidget
When u setup a web service in your app you assign it a "Web Reference Name", this is what u use to asses the web service, ie if I called it Woof then I would do:
VB Code:
Dim MyWebService As new Woof
Woka
Thanks Woka. finally it works its because last time I download the web reference and save it into my root and I got mess up, this time I just add web reference directly from the URL and I see the default web reference name so I understand what you mean already.
Anyway, now no error but I just need a simple currency converter that just convert a few country to country, what should I do now to setup a basic currency converter with that code loaded?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|