Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Seven simple steps to enable HTTPS on WCF WsHttp bindings

, 24 May 2009 CPOL
Seven simple steps to enable HTTPS on WCF WsHttp bindings.
WsHttpCertificates.zip
WsHttpCertificates
WsHttpCertificates
App_Data
bin
WsHttpCertificates.dll
obj
Debug
TempPE
Properties
Service1.svc
WsHttpCertificates.csproj.user
WsHttpClient
App_Data
bin
WsHttpClient.dll
obj
Debug
TempPE
Properties
Service References
ServiceReference1
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
Service1.disco
Service1.wsdl
WsHttpClient.ServiceReference1.CompositeType.datasource
WsHttpClient.csproj.user
WsHttpClientConsumer
App_Data
bin
WsHttpClientConsumer.dll
obj
Debug
TempPE
Properties
Service References
ServiceReference1
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
Service1.disco
Service1.wsdl
WsHttpClientConsumer.ServiceReference1.CompositeType.datasource
WsHttpClientConsumer.csproj.user
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WsHttpCertificates
{
    // NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in Web.config.
    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        string GetData(int value);

        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);

        // TODO: Add your service operations here
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150123.1 | Last Updated 25 May 2009
Article Copyright 2009 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid