如何在 C# 中制作 SOAP/WSDL 客户端? [英] How to make a SOAP/WSDL client in C#?

查看:28
本文介绍了如何在 C# 中制作 SOAP/WSDL 客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在用它玩 PHP 并且得到了一些工作,我所做的是:

I have been playing around in PHP with it and got something to work, what i did was:

$client = new SoapClient("http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl");
$fetchedArr = $client->GetCityForecastByZIP(array("ZIP" => "10451")); //get the weather in the bronx YO!

现在我希望我的应用程序 i WPF/C# 也这样做.c# 中的等价物是什么?

And now i would like my application i WPF/C# to do the same. What is the equivalent in c#?

推荐答案

最简单的方法是使用 VS 并添加 Web 引用.这会自动为您创建存根

The simplest way is to use VS and add a web reference. This automatically creates the stub for you

这篇关于如何在 C# 中制作 SOAP/WSDL 客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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