我只是在寻找一个使用已发布的 HTTP-GET Web 服务的 ASP.NET Web 应用程序(在 C# 中)的示例。
看起来应该很容易在网上找到,但我还没有遇到过。
我只是在寻找一个使用已发布的 HTTP-GET Web 服务的 ASP.NET Web 应用程序(在 C# 中)的示例。
看起来应该很容易在网上找到,但我还没有遇到过。
在 Visual Studio 2010 中右键单击您的项目并选择选项“ Add Web-Reference...
”。
在“添加 Web 引用”对话框中,键入 Web 服务的 URL,例如http://www.startvbdotnet.com/web/sample2.asmx和“Web 引用名称”,例如“ com.startvbdotnet.www
”。
您的项目将生成大量代码。“Web 参考名称”将是生成的命名空间的名称。
该命名空间的类将像“普通”类一样工作,但在幕后,方法调用将是 Web 服务调用。
com.startvbdotnet.www.Sample teste = new com.startvbdotnet.www.Sample();
int result = teste.Add(1, 2);