Click here to Skip to main content
12,947,643 members (61,893 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am developing a web service that needs to sit on a secure server. I've done this in the web config:
        <behavior name="StdBehavior">
            <serviceMetadata httpGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
    <basicHttpBinding >
        <binding name="secureBinding">
            <security mode="Transport">
                <transport clientCredentialType="Certificate" />
    <service behaviorConfiguration="StdBehavior" name="A.DevelopmentSvc">
                <add baseAddress="https://blah/blah/CrisSvc"/>
        <endpoint address="/" 
                  name="devEndpoint" contract="CrisCodeWcf.ICrisSvc" 
        <endpoint address="mex" 

...but I get this error when I try to browse to the service in IE:

Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https].
Posted 2-Feb-12 2:45am
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

Hi John,

I usually run svcutil directly, using a batch file. This has a few benefits, chief among them is that you don't need to talk to a running service.

svcutil is capable of generating the required code based on your service definition from the implementation assembly.

Here is the contents of a batch file I use for this purpose:

rem set up path so svcutil can be found
call c:\usr\bin\initvc.cmd

SET ROOTDIR=C:\Src\AjaWorks\AjaWorks.Oracle.Tools
rem this is where the service implmentation assembly is located
SET WCFSERVICEDIR=%ROOTDIR%\Goodtech.Databox.DX.DataService\bin\Debug
rem this assembly contains types shared between the client and server
SET COMMONTYPESDLL=%ROOTDIR%\Generated\bin\Debug\Goodtech.Databox.DX.dll

rem let svcutil generate wsdl
svcutil %ROOTDIR%\Goodtech.Databox.DX.DataService\bin\Debug\Goodtech.Databox.DX.DataService.dll
rem let svcutil generate code ( service reference )
svcutil %WCFSERVICECLIENTDIR%\wsdl\*.wsdl %WCFSERVICECLIENTDIR%\wsdl\*.xsd /namespace:*,Goodtech.Databox.DX.Client /targetClientVersion:Version35 /language:C# /ct:System.Collections.Generic.List`1 /out:DataServiceReference.cs /config:GeneratedApp.config /reference:%COMMONTYPESDLL%

A typical solution will usually have at least:

  • An assembly for types shared between client and server

  • An assembly for the service implementation

  • A windows forms application that hosts the service implementation - for development purposes

  • A windows service that hosts the service implementation - for deployment

  • A client API assembly that wraps the code generated by svcutil, adds logging, connection handling, etc.

  • The client application

Everything that determines how the client and server talks to each other goes into the application configuration files.

Best regards
Espen Harlinn
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

It appears that you can't use the basicHttpBinding under the bindings for https, check this link where they had the exact same problem and used webhttpbinding.

WCF Bindings needed for HTTPS[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I guess, you cannot use clientCredentialType="Certificate" with basicHttpBinding.

try using clientcredentialtype="None".

Edit: Another point to make:

you have written:
<serviceMetadata httpGetEnabled="true"/>

I guess it needs to be:
<behavior name="StdBehavior">
          <serviceMetadata httpsGetEnabled="true" />
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

As others have pointed out the binding will probably need to change; something like wsHttpBinding. I have found this link to msdn helpful:

Common Security Scenarios[^]

Also, to get your wsdl you will probably need to turn on:
<servicemetadata httpsgetenabled="true"></servicemetadata>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,134
CHill60 3,275
Maciej Los 2,563
Jochen Arndt 1,935
ppolymorphe 1,795

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 3 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100