Nnngghhh! I wrote a long piece of text with couple of examples and accidentaly closed browser :(
But anyway. You have Visual Studio? If not, just skip the following...
Open VS and create new web service then write something like this (VS writes some of this for you):
Code:
[WebService(Namespace = "http://foo.bar")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
class CurrencyConverter : System.Web.Services.WebService
{
public CurrencyConverter { }
[WebMethod]
public decimal Convert(decimal value, string currencyFrom, string currencyTo)
{
return 0; // Do your stuff here
}
}
Then just for practice and example add new Windows Forms project to your solution. Add Web Reference to your newly create Web Service (click add web reference and select 'web services in this solution' or something like that). Accept default settings, just clickety click away.
Then add textbox and button to your form. Double click button and write something like this:
Code:
decimal value = decimal.Parse(TextBox1.Text);
localhost.CurrencyConverter c = new localhost.CurrencyConverter();
value = c.Convert(value, "from", "to");
TextBox1.Text = value.ToString("0.##");