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

Eight steps to enable Windows authentication on WCF BasicHttpBinding

, 9 May 2009 CPOL
Eight basic steps by which we can enable Windows authentication security on BasicHttpBinding.
WCFWindowsBasicHttpBinding.zip
WCFWindowsBasicHttpBinding
WCFWindowsBasicHttpBinding
App_Data
bin
WCFWindowsBasicHttpBinding.dll
obj
Debug
TempPE
Properties
Service1.svc
WCFWindowsBasicHttpBinding.csproj.user
WebApp
App_Data
bin
WebApp.dll
obj
Debug
TempPE
Properties
Settings.settings
Web References
localhost
CompositeType.datasource
Reference.map
Service1.disco
Service1.wsdl
WebApp.csproj.user
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFWindowsBasicHttpBinding
{
    // 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
Web01 | 2.8.1411023.1 | Last Updated 10 May 2009
Article Copyright 2009 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid