简体   繁体   English

C#SOAP Web服务服务器提交了协议冲突。 Section = ResponseStatusLine

[英]C# SOAP Web Service The server committed a protocol violation. Section=ResponseStatusLine

I have an application that calls a web service... I get an error that I am just pulling the few hairs I have left on my head out maybe someone can help. 我有一个调用Web服务的应用程序...我收到一个错误,我只是拔掉了我遗留的几根毛发,也许有人可以帮忙。

Here is the code: 这是代码:

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);

I keep getting the error: 我不断收到错误:

The server committed a protocol violation. 服务器提交了违反协议的协议。 Section=ResponseStatusLine Section = ResponseStatusLine

I did notice that the URL changes from HTTPS to HTTP could this be the problem? 我确实注意到URL从HTTPS更改为HTTP ,这可能是问题吗?

I also tried adding the following to my config file and it still did not work: 我也尝试将以下内容添加到我的配置文件中,但仍然无法正常工作:

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

How can I fix this? 我怎样才能解决这个问题?

Here is how I fixed it... 这是我解决的方法...

I noticed that the URL was changing from HTTPS to HTTP...The HTTP URL was the culprit so I updated it to manually set the URL and it worked. 我注意到URL从HTTPS更改为HTTP ... HTTP URL是罪魁祸首,因此我对其进行了更新以手动设置URL,然后它起作用了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 服务器提交了违反协议的协议。 C#中的Section = ResponseStatusLine - The server committed a protocol violation. Section=ResponseStatusLine in c# C# OData 服务器违反了协议。 部分=响应状态行 - C# OData The server committed a protocol violation. Section=ResponseStatusLine C#:HttpClient,服务器提交了协议违规。第= ResponseStatusLine - C#: HttpClient, The server committed a protocol violation. Section=ResponseStatusLine 服务器违反了协议。 在 c# ASP.NET 中使用 XmlDocument 的 Section=ResponseStatusLine - The server committed a protocol violation. Section=ResponseStatusLine in c# ASP.NET using XmlDocument 服务器违反了协议。 Section=ResponseStatusLine 错误 - The server committed a protocol violation. Section=ResponseStatusLine ERROR WebException:服务器提交了协议违规。 Section = ResponseStatusLine(调用Marketo SOAP API) - WebException: The server committed a protocol violation. Section=ResponseStatusLine (call Marketo SOAP API) Windows Azure Web角色useUnsafeHeaderParsing =“ true”无法正常工作,得到“服务器已违反协议。 Section = ResponseStatusLine” - Windows Azure web role useUnsafeHeaderParsing=“true” not working getting “The server committed a protocol violation. Section=ResponseStatusLine” 带有Internet代理服务器的Windows WCF客户端显示错误服务器提交了协议违规。 第= ResponseStatusLine - Windows WCF client with internet proxy server showing error The server committed a protocol violation. Section=ResponseStatusLine 服务器提交了违反协议的协议。 Section = ResponseStatusLine(尝试了许多解决方案后无济于事) - The server committed a protocol violation. Section=ResponseStatusLine(Tried many soltions nothing worked) 服务器提交了违反协议的协议。 使用Tor代理时,Section = ResponseStatusLine - The server committed a protocol violation. Section=ResponseStatusLine when using a tor proxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM