如何调用外部服务器/ web服务的方法呢? [英] How to invoke methods on external server / webservice?
问题描述
我想援引 http://www.ibanbic.be/IBANBIC.asmx <方法/ A>
我已经读了很多论坛和教程,但所有的信息是建立在ASP.net web服务,或使用AJAX / JavaScript的。我只需要调用的函数。calculateIBAN1
一个教程一步一步将是真棒。
在此先感谢
一个教程一步一步将是真棒。
块引用>在Solution Explorer中的
参考
菜单中的项目右击并选择添加服务引用...
。在地址键入http://www.ibanbic.be/IBANBIC.asmx
,然后点击开始
然后确定
。这将产生一个强类型的客户端代理,让您调用该服务:使用(VAR的客户=新ServiceReference1.BANBICSoapClient(IBANBICSoap))
{
字符串结果= client.calculateIBAN1(异国,一些账户);
}请注意,这也将增加一个
&LT; system.serviceModel方式&gt;
来你的web.config文件,你可以管理WCF客户端的端点另外,您可以使用
svcutil.exe的
来生成该服务的客户端代理,如图的本文
MSDN上。I'm trying to invoke methods from http://www.ibanbic.be/IBANBIC.asmx
I have read a lot of forums and tutorials, but all the information is about setting up a webservice in ASP.net or using ajax / javascript. I just need to call the function: calculateIBAN1.
A tutorial step by step would be awesome.
Thanks in advance
解决方案A tutorial step by step would be awesome.
Right click on the
References
menu in your project in the solution explorer and chooseAdd Service Reference...
. In the address typehttp://www.ibanbic.be/IBANBIC.asmx
and clickGo
and thenOK
. This will generate a strongly typed client proxy that will allow you to invoke the service:using (var client = new ServiceReference1.BANBICSoapClient("IBANBICSoap")) { string result = client.calculateIBAN1("iso country", "some account"); }
Notice that this will also add a
<system.serviceModel>
to your web.config file where you could manage the WCF client endpoints.Alternatively you could use the
svcutil.exe
to generate a client proxy for the service as shown inthis article
on MSDN.这篇关于如何调用外部服务器/ web服务的方法呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!