调用Curreny Converter Web服务 [英] Calling the Curreny Converter Web Service

查看:110
本文介绍了调用Curreny Converter Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个C#项目来调用货币转换器WebService来转换用户输入的源和目标货币。



网络服务网址

http://www.webservicex.net/CurrencyConvertor.asmx?WSDLservice



这是我当前项目的样子。

 使用系统; 
使用 System.Collections.Generic;
使用 System.ComponentModel;
使用 System.Data;
使用 System.Drawing;
使用 System.Linq;
使用 System.Text;
使用 System.Windows.Forms;
使用 WindowsFormsApplication21.net.webservicex.www;

namespace WindowsFormsApplication21
{
public partial class Form1:Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click( object sender,EventArgs e)
{
net.webservicex.www.Currency.AUD.ToString();
net.webservicex.www.Currency.USD.ToString();
}
}
}



不知何故必须有一种输入源货币并将其转换为目标货币的方法但我只是找不到执行转换的语法。



请提供一个如何将其添加到我的项目中的示例。



谢谢。

解决方案

你好史蒂夫,



按照服务文档此服务用于获取两种货币之间的转换率。必须进行实际转换。 [ ^ ] URL解释了可以调用服务的各种方式。

您甚至可以使用HttpWebRequest类使用POST方法调用此服务。



问候,


我找到了自己问题的答案。这是链接

http://stackoverflow.com/questions/9589748/currency -convertor-web-service [ ^

I created a C# project to call the Currency Converter WebService to convert the user inputted source and destination Currencies.

Web Service URL
http://www.webservicex.net/CurrencyConvertor.asmx?WSDLservice

This is what my current project looks like.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApplication21.net.webservicex.www;

namespace WindowsFormsApplication21
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            net.webservicex.www.Currency.AUD.ToString();
            net.webservicex.www.Currency.USD.ToString();
        }
    }
}


Somehow there must be a way of inputting the source currency and converting it to a destination currency but I just can't find the syntax to perform the conversion.

Please provide me a sample of how to add this to my project.

Thank you.

解决方案

Hello Steve,

As per the service documentation this service is for obtaining the conversion rates between the two currencies. The actual conversion will have to be done. This[^] URL explains the various ways the service can be called.
You can even use HttpWebRequest class to invoke this service using POST method.

Regards,


I found the answer to my own question. Here's the link
http://stackoverflow.com/questions/9589748/currency-convertor-web-service[^]


这篇关于调用Curreny Converter Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆