About The Author
Michael Flynn is a Web Developer at Terralever, an interactive marketing agency based in Tempe, AZ. He specializes in web technologies that include C# .NET, SQL, XML, AJAX, jQuery, Flash, and also skills in Photoshop and Illustrator. He was been involved in web development since 1998, and earned a Bachelors and Masters degree in Computer Engineering and Computer Science from the Univerisity of Louisville and holds an MSCT certificate in Web Applications.
Calendar
<<  September 2010  >>
SMTWTFS
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Use a WCF Service with HTTP and HTTPS in C#

I had a problem with a WCF service that was having problems on a secure page using SSL.  The error said the endpoint could not be found.  I found some resources on making a service HTTPS ready, but not for both.  I finally figured it out that I need two endpoints pointing to the same service.  One endpoing contained another property called "bindingConfiguration" that maps a binding that has a mode of transport which enables an endpoint for https.  The bolded text below is what you need to enable a service for HTTPS.

   

<system.serviceModel>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>

    <behaviors>

        <endpointBehaviors>

            <behavior name="WebServicesBehavior">

                <webHttp/>

            </behavior>

        </endpointBehaviors>

    </behaviors>

    <services>

        <service name="WebService">

            <endpoint binding="webHttpBinding" contract="IWebService" behaviorConfiguration="WebServicesBehavior"/>

            <endpoint binding="webHttpBinding" bindingConfiguration="webBinding" contract="IWebService" behaviorConfiguration="WebServicesBehavior"/>

        </service>

    </services>

    <bindings>

        <webHttpBinding>

            <binding name="webBinding">

                <security mode="Transport">

                    <transport clientCredentialType="None"/>

                </security>

            </binding>

        </webHttpBinding>

    </bindings>

</system.serviceModel>

Posted on 10/18/2008 12:54:00 AM by cblaze22

Permalink | Comments (3) | Post RSSRSS comment feed |

Categories: ASP.NET | Development Tips | Tips | WCF

Tags: ,

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Comments

December 22. 2009 15:54

Moving overseas

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

Moving overseas gb

May 7. 2010 03:05

quick cash

This article gives the light in which we can observe the reality. This is very nice one and gives in-depth information. Thanks for this nice article.

quick cash us

June 18. 2010 00:02

tuts9.com

Pingback from tuts9.com

WCF configuration for WebHttpBinding(Restful) for supporting both HTTP and HTTPS | The Largest Forum Archive

tuts9.com

Add A Comment




  Country flag