Results 1 to 11 of 11

Thread: Where can I get real time exchange rates? [resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    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.

  2. #2
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    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

  4. #4
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    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?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2004
    Location
    Cape Town, South Africa
    Posts
    149

    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

  6. #6
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306

    Re: Where can I get real time exchange rates? [resolved]

    Thats great, thanks v.much

  7. #7
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: Where can I get real time exchange rates? [resolved]

    Quote 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?

  8. #8
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    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

  9. #9
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: Where can I get real time exchange rates? [resolved]

    Quote 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.

  10. #10
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    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:
    1. Dim MyWebService As new Woof

    Woka

  11. #11
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: Where can I get real time exchange rates? [resolved]

    Quote 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:
    1. 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
  •  



Click Here to Expand Forum to Full Width