tags:

views:

109

answers:

1

Hiyee,I was trying to use the web service for currency rate to get the rate, althought I have already add web reference to["http://www.webservicex.net/CurrencyConvertor.asmx"] but I still do not know how to retrieve it from there. I'm using asp.net vb. Thanks!...

A: 

If you are using Visual Studio then you can simply right-click your project and choose "add service reference" to your project specifying "http://www.webservicex.net/CurrencyConvertor.asmx" as address and then add code like this

  Dim client = New CurrencyConvertorSoapClient()
  Dim result = client.ConversionRate(Currency.EUR, Currency.USD)
  Console.WriteLine(result)
dh
oh, but where to put those code? Sorry for asking this question, quite new with this.
tohru
in the place where you need the conversion rate, I'm not sure where it is in your project
dh
oh, but there's error. The currencyconvertorysoapcliekt is not declare...Is it I missed out something?
tohru
I think you are missing the namespace import likeImports MyProject.CurrencyConvertorService
dh