0

In system.service / behaviours / servicebehaviours

I have the following behaviour:

<behavior name="pubajaxAspNetAjaxBehavior">
  <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"  />
  <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

With both these properties httpGetEnabled="true" and httpsGetEnabled="true" in place it means any requests to my webservice over http now throw the error:

Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].

Is it possible to have a WCF service that accepts http and https requests?

maxp
  • 24,209
  • 39
  • 123
  • 201

1 Answers1

2

I don't think you can have them both true on the same endpoint, but you can use different bindings for different endpoints.

You can use bindings for that

<bindings>
      <basicHttpBinding>
        <binding name="HttpBinding">
          <security mode="None">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>
        <binding name="HttpsBinding">
          <security mode="Transport">
              <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

Please look at that post

Stackoverflow post

Community
  • 1
  • 1
Pinchy
  • 1,506
  • 8
  • 28
  • 49