来自asmx Web服务的“请求失败,响应为空”

时间:2018-08-20 11:28:28

标签: c# wpf web-services soap azure-app-service-envrmnt

我们有一个“ .asmx” Web服务,该服务被称为VSTO外接程序项目。安装加载项后,某些客户端会收到错误消息,例如“请求失败,响应为空”。对于其他一些客户,它的工作正常。可能是什么原因?

注意:

  1. 我们将Web服务添加为Web参考
  2. 对于某些客户来说,它的工作符合预期
  3. 我们将服务托管为Azure App服务。

代码示例:

 try { 
        System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
        APMService svc = new APMService();
        System.Net.ServicePointManager.DefaultConnectionLimit = 40;
        LoginResponseStatus lresponse = svc.LoginUser("UserName", "Password", "LicenceKey");
        txtBox.Text = lresponse.status.ToString();
        }
        catch (Exception ex)
        {
            txtBox.Text = ex.Message + "\n" + ex.StackTrace + "\n" + ex.InnerException;
        }

错误响应:

    System.Net.WebException: The request failed with an empty response.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Service.MethodName(String loggedInUserEmail)
   at ServiceCallerLocatin.MethodName(String LoggedInUserEmail)
Stack trace:
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

0 个答案:

没有答案