Search code examples
c#wcfasp.net-core.net-core

WCF in .NET Core: How to avoid additional calls without authorization?


There is a Java soap-service. I have 2 WCF clients for connecting to it: .NET Framework 4.5 and .NET Core 2.0.

This Java-service uses basic authorization. And the problem was: WCF client in .NET Framework 4.5 sent http head request without auth data before sent http post request with data. Owners of Java service asked me to avoid this. I've added in web.config:

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

And problem was solved. But now I have WCF client in .NET Core 2.0 with the same functional. I've read in the discussion in GitHub that the property "100-Continue is always false on Windows". Is there any ways to avoid unauthorized head requests before authorized post request in WCF in .NET Core 2.0 ?


Solution

  • The decision had 2 parts : 1. to avoid http HEAD request I used balancer|proxy, I have no code here, it's another software 2. to avoid http POST requests without authorization, i've used this article