Mickey Puri
Mickey Puri

Reputation: 889

WCF no SVC file and no Config: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding

Am using the new VS2010 template for Rest Web Services, which sets up the service without an SVC file and with minimum config, and you set up the route in the global.asax.cs file.

On deploying my WCF Rest Service to test environment where its accessed by https, I get an exception: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].

Have found solutions to this on Scott's Blog and Taciturn Discourse

However these solutions are based on having the WCF being configured via the more traditional config route with full specification of endpoint address, binding, contracts.

In the simplified template approach, as we don't setup the endpoint ABC explicitly in config, then how can we fix this issue of the missing base address?

Upvotes: 1

Views: 1294

Answers (1)

Mickey Puri
Mickey Puri

Reputation: 889

Sorted this out, because using https, need to specify that security is being set at the transport layer. So include this in the system.serviceModel config:

<bindings>
  <webHttpBinding>
    <binding>
      <security mode="Transport" />
    </binding>
  </webHttpBinding>
</bindings>

My thanks to the two posts below that provided the solution, however found I did not need to put in all their recommendations to get it to work

Configuring WCF 4 with routing (global.asax) for both http & https endpoints

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/1dd991a1-e32f-4035-a406-994729858b40

Cheers, Mickey

Upvotes: 2

Related Questions