hello guys
i have an service address about currency Converter. but i am unable to proper use in my application so kindly help me that how can i convert any given curreny into required currency...
service address is given below
http://www.webservicex.net/currencyconvertor.asmx
Reply Soon
Thanks.
Loading
Faisal AnsariPosted May 10, 2011, 9:06 AM
i will try and then i'll report you ...
omkar mhaiskarPosted May 10, 2011, 5:44 AM
I will guide you through the process of creating simple currency converter using Foxrate.com XML RPC API. This API is free to use. to implement this in your site.
just go through with following :-
In order to connect to the XML-RPC API, you will need an XML-RPC client. First of all add latest version of "CookComputing.XmlRpc" to your project. I have used ver 2.5 in my project, since it has some bug fixed related to permission and security when running on live server.
you will get dll here Source: XML-RPC client DLL download link: http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.5.0.zip
References:
Add this dll in youe project after that.
Add following references in your code behind files:
Now, the code behind activity by defining endpoint and creating an Interface.
XmlRpcUrl("http://foxrate.org/rpc/")]
public interface IXchangeRate
{
[XmlRpcMethod("foxrate.currencyConvert")]
XmlRpcStruct GetXchangerate(
string from,
string to,
double amount); // Please note that Foxrate.org RPC accepts "Float" data type however, CookComputing.XmlRpc does not provide support for "Float", thus we use double instead.
}
public void GetRates(string strTo, string strFrom, double dAmount)
{
IXchangeRate proxy = (IXchangeRate)XmlRpcProxyGen.Create(typeof(IXchangeRate));
XmlRpcStruct MyStruct;
MyStruct = proxy.GetXchangerate(strTo, strFrom, dAmount);
foreach (DictionaryEntry d in MyStruct)
{
Response.Write(d.Key + " : " + d.Value);
}
}
Finally call the function as under:
GetRates("INR", "USD", "10.0?);
You can also visit the working sample, I implemented on of live site: http://shapemyyatra.com/currency-converter.aspx
Faisal AnsariPosted May 9, 2011, 9:10 AM
Shirsendu NandiPosted May 9, 2011, 8:40 AM
http://www.codeproject.com/KB/webservices/WebServiceConsumer.aspx
and you have to also see what are the method used by the currency converter webservices..
Faisal AnsariPosted May 9, 2011, 8:33 AM
Shirsendu NandiPosted May 9, 2011, 8:29 AM