Search This Blog

Lets go..




Manage your Inventory | Grow your restaurant business | Manage your Employee | Control your accounts

Monday

How to use web service

By: Mohammad Tuaha

How to use web service from free builtin web service.
Download Project


Hello everyone today I like to share how to implement or use or consume a free popular web service into web page. My free web service is currency convertor. I will consume it on my local .NET web page.
But users can consume it any Programming language like JSP, PHP, and Python. I will show you how to use a web service into your local page using C# ASP.NET.
Our free web service reference is http://www.webservicex.net/CurrencyConvertor.asmx

How use it’s on web page
Step 1:
Copy the web service url 
Add web Reference à paste Link into URL textbox




Step 2:
Here is the Code sample.


     protected void btnCurrency_Click(object sender, EventArgs e)
        {
            currencyConversionRate.CurrencyConvertor objWS = new currencyConversionRate.CurrencyConvertor();                     
            double usdToinr = objWS.ConversionRate(currencyConversionRate.Currency.CAD,currencyConversionRate.Currency.BDT);
            lblCCresult.Text = Convert.ToString(Convert.ToDouble(txtCurrency.Text) * Convert.ToDouble(usdToinr.ToString()));
        }


Output is:  
 

No comments:

Post a Comment

Thanks for your opinion