Does ServicePointManager.Expect100Continue = false remain set application-wide after setting it once?

StackOverflow https://stackoverflow.com/questions/21701470

Domanda

I have the following code:

ServicePointManager.Expect100Continue = false;

on my main windows form frmMain_Load event. I have many forms and classes where different web services are called but these are always called after completion of frmMain_Load event.

So, ServicePointManager.Expect100Continue will remain as set in all web service calls in all forms and classes? or do I have to set it to false on every web service call?

It is .NET 2.0 desktop application in C#.

Note: I am sorry I posted such a dumb question. I can check in debugger by setting a watch on that value.

Nessuna soluzione corretta

Altri suggerimenti

Probably not the answer. but you can set the expect100Continue value to your App.Config. Setting this will be applied to the all web service call. you don't need to set it on each webservice call separately.

put it inside Configuration->system.net->settings

  <system.net>
    <settings>
      <servicePointManager expect100Continue="false"/>
    </settings>
  </system.net>

Note: Do not change this settings unless you decided to ignore the TCP 100Continue response result.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top