Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone, I am developing website for gold merchant. As per project requirements, i want to add live gold price to website. I found one free web service to get live gold rate. but i am new to web services, I don't know how to use web service, please tell me how to use web service in my website. Please check the following link to how can i use and how can i get price from the following web service. Thanks in advance...

Live gold price web service link is here....

http://www.freewebservicesx.com/GetGoldPrice.asmx?op=GetCurrentGoldPrice[^]
Posted

1 solution

Add a default.aspx page into your site.
and add two text boxes for entering username and password and one button to check gold price

and right click on References then add webreference if its not there
add service reference then click advanced there you can see add web reference button and give this url in url field http://www.freewebservicesx.com/GetGoldPrice.asmx[^]

and add reference to your site.


on button click add below code

C#
com.freewebservicesx.www.GetGoldPrice mys = new com.freewebservicesx.www.GetGoldPrice();
           string a=firstnum.Text;
           string b=secondnum.Text;
           string[] c = mys.GetCurrentGoldPrice(a, b);
          
           foreach (var d in c)
           {
               ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('"+d+"');", true);

           }


run your application and
You have to register in Free Web Service site and pass your username and password on the textboxes and click on button then you will get gold price as alert.
You can modify it as per your requirement
 
Share this answer
 
v2
Comments
Nagesh Reddy 8-Jul-13 8:38am    
Thank You for your response! I did what u told but result showing 0(zero)....
Tony Tom.k 8-Jul-13 8:46am    
Nagesh What username and password you have passed did you registered in that site ?..
http://www.freewebservicesx.com/GoldSpotPrice.aspx[^]
check with your username and password in that above link if you have registered then after invoking you can see the gold price..
If its not register there and try again..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900