Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#SOAP Web服务服务器违反了协议。区段=响应STATUSLINE_C#_Web Services_Soap_System.net.webexception - Fatal编程技术网

C#SOAP Web服务服务器违反了协议。区段=响应STATUSLINE

C#SOAP Web服务服务器违反了协议。区段=响应STATUSLINE,c#,web-services,soap,system.net.webexception,C#,Web Services,Soap,System.net.webexception,我有一个调用web服务的应用程序。。。我犯了一个错误,我只是把我头上剩下的几根头发拔了出来,也许有人能帮我 代码如下: Service_RetrieveIntervalDataserviceagent srv = new Service_RetrieveIntervalDataserviceagent(); srv.Credentials = new NetworkCredential(UserName, Password, Domain); MDMIntervalDataInput dataI

我有一个调用web服务的应用程序。。。我犯了一个错误,我只是把我头上剩下的几根头发拔了出来,也许有人能帮我

代码如下:

Service_RetrieveIntervalDataserviceagent srv = new Service_RetrieveIntervalDataserviceagent();
srv.Credentials = new NetworkCredential(UserName, Password, Domain);
MDMIntervalDataInput dataInput = new MDMIntervalDataInput();
 string Url = srv.Url;
DeviceList deviceList = new DeviceList();

deviceList.Type = DeviceListType.M;
deviceList.DeviceId = "2862,2876,2877".Split(',');

//Setup dataInput
dataInput.ApplicationName = "TestApp";
dataInput.StartDate = DateTime.Now.AddDays(-3).ToString("MM/dd/yyyy");
dataInput.EndDate = DateTime.Now.AddDays(-3).ToString("MM/dd/yyyy");
dataInput.OutputMode = MDMIntervalDataInputOutputMode.Wire;
dataInput.DeviceList = deviceList;
srv.RetrieveIntervalData_V10(dataInput);
我不断得到错误:

服务器违反了协议。区段=响应STATUSLINE

我注意到URL从HTTPS更改为HTTP,这可能是问题所在吗

我还尝试将以下内容添加到我的配置文件中,但仍然不起作用:

<system.net> 
  <settings> 
    <httpWebRequest useUnsafeHeaderParsing="true" /> 
  </settings> 
</system.net> 


我如何修复它?

以下是我如何修复它的

我注意到URL正在从HTTPS更改为HTTP…HTTP URL是罪魁祸首,所以我更新了它,以手动设置URL,它成功了