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);
エラーが発生し続けます:
サーバーがプロトコル違反を犯しました。Section=ResponseStatusLine
URL がHTTPSからHTTPに変更されたことに気付きましたが、これが問題でしょうか?
また、構成ファイルに次を追加しようとしましたが、それでも機能しませんでした。
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
どうすればこれを修正できますか?