Click here to Skip to main content
11,811,971 members (55,071 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Windows service Web
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
0 KrunalRohit 354
1 Palash Mondal_ 185
2 CHill60 180
3 OriginalGriff 178
4 Abhinav S 175
0 OriginalGriff 3,888
1 KrunalRohit 2,392
2 CPallini 2,240
3 Maciej Los 2,155
4 ppolymorphe 1,725

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 3 Feb 2012
Copyright © CodeProject, 1999-2015
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