C# 4.7.2 asp.net经典Web服务,通过winforms使用wsdl.exe生成的代理连接到Web服务。
我有Web应用程序成功连接到Web服务,但我有一个用C#/winforms编写的工具,用于测试Web服务是否处于活动状态并在各个级别(dev/prod/etc)工作
通过https调用.asmx Web服务的最简单方法是什么?
这是它现在的样子,但如果放弃代理更容易的话,我也可以接受
AdStudent.ADStudent ws = new AdStudent.ADStudent();
ws.Url = "https://jcdcadstudent.bob.org/adstudent.asmx";
string str = ws.GetGuidString("Brown.Eric");
(错误=基础连接已关闭:发送时发生意外错误)
在Web应用程序中,只需更改url即可,但在winform中则不行。
2条答案
按热度按时间8aqjt8rx1#
我已经在WinForms中做了类似的事情,但是我向API发送请求,而不是MVC Web应用程序,所以我不知道这是否有帮助,但是我将在这里粘贴我的WinForm应用程序向API发送请求的一个方法:
9nvpjoqh2#
上面的答案对我不起作用,我最后用肥皂来做,所以
请查看此URL以了解在SOAP上出错的详细信息
C# .netcore 3.1,从winform调用asmx Web服务
希望它能帮助到别人!