Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 112477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:33:03+00:00 2026-05-11T02:33:03+00:00

I cannot figure out how to enable per-session instances for my WCF service while

  • 0

I cannot figure out how to enable per-session instances for my WCF service while using HTTPS. (I’m not an ASP.NET expert but don’t want to use ASP.NET session state if possible.) I am using .NET Framework 3.0.

I have arrived at the following contradiction and am hoping that someone can tell me where there is a flaw in the logic.

1) The service must be hosted on IIS 6 due to client mandate.

2) The service needs to maintain state between calls, including SqlConnection and SqlTransaction instances (ugly but necessary due to project constraints).

3) Therefore I need to use the wsHttpBinding.

4) The service needs to be able to access user authentication info from HttpContext.Current.User.Identity (e.g. using Windows security in IIS).

5) HTTPS is therefore required.

6) Transport-level security must therefore be configured on the binding.

7) Configuring the service to require sessions means I have to configure the wsHttpBinding to use Reliable Sessions.

8) This requires that message-level security is configured on the binding.

I.e. (6) and (8) are mutually exclusive.

It seems that using WCF sessions requires that I use message-level security, which prevents me from using HTTPS.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:33:04+00:00Added an answer on May 11, 2026 at 2:33 am

    3) True, wsHttpBinding and wsDualHttpBinding are the only HTTP bindings that support sessions

    5) False, in order to authenticate the service callers you don’t necessarily need to have any transport-level security (such as SSL/HTTPS). The only requirement is to configure IIS to enable Integrated Windows Authentication for a virtual directory. Then in WCF you have three possibilities to enable this scenario:

    a) Use transport-level security on the wsHttpBinding with Windows credentials (HTTPS)

    <system.serviceModel>     <bindings>         <wsHttpBinding>             <binding name='SecurityEnabledWsHttp'>                 <security mode='Transport'>                     <transport clientCredentialType='Windows' />                 </security>             </binding>         </wsHttpBinding>     </bindings> </system.serviceModel> 

    b) Use message-level security on the wsHttpBinding with Windows credentials (HTTP)

    <system.serviceModel>     <bindings>         <wsHttpBinding>             <binding name='SecurityEnabledWsHttp'>                 <security mode='Message'>                     <message clientCredentialType='Windows' />                 </security>             </binding>         </wsHttpBinding>     </bindings> </system.serviceModel> 

    c) Run your service under the ASP.NET Compatibility Mode and enable Windows Authentication in ASP.NET (HTTP)

    <system.web>     <authentication mode='Windows' /> </system.web> 

    Note that in a and b you will access the identity of the caller from within a service this way:

    OperationContext.Current.ServiceSecurityContext.WindowsIdentity 

    6) True, transport-level security must be enabled on the wsHttpBinding in order to use HTTPS

    7) False, Reliable Sessions is a particular implementation of Reliable Messaging for WCF sessions. Reliable Messaging is a WS-* standard specification designed to guarantee message delivery on an unreliable network. You can use WCF sessions without Reliable Messaging, and viceversa. Sessions are enabled on the service contract with this attribute:

    [ServiceContract(SessionMode=SessionMode.Required)] public interface IMyService {     // ... } 

    Also remember that in order to maintain state between service calls you will explicitly have to enable the appropriate instance mode on the service contract implementation:

    [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)] public class MyService : IMyService {     // ... } 

    There are two kinds of sessions in WCF: Secure Sessions and Reliable Sessions. The default setting for both wsHttpBinding and netTcpBinding is to use Secure Sessions.
    For wsHttpBinding this is accomplished with message-level security by using the client’s credentials, which is the default setting for the binding.
    For netTcpBinding instead, the session is established at the tranport level by using the facilities of the TCP protocol.
    This means that simply switching to wsHttpBinding or netTcpBinding will enable support for WCF sessions.
    The alternative is to use Reliable Sessions. This has to explicitly be enabled in the binding configuration, and removes the requirement of using message security for the wsHttpBinding. So this will work:

    <bindings>      <wshttpbinding>          <binding name='ReliableSessionEnabled'>              <reliablesession enabled='True' ordered='False' />              <security mode='None' />          </binding>      </wshttpbinding>  </bindings> 

    8) False, Reliable Sessions are used independently of the security settings of the communication channel.

    For a more detailed explanation, have a look at this article.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 263k
  • Answers 263k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The 403 Status Code means: 10.4.4 403 Forbidden The server… May 13, 2026 at 11:59 am
  • Editorial Team
    Editorial Team added an answer Sure, it's possible. Whether or not it's usable will depend… May 13, 2026 at 11:59 am
  • Editorial Team
    Editorial Team added an answer You can rename files, add them your own extension, like… May 13, 2026 at 11:59 am

Related Questions

How can I use WIA and Twain in C#? The TWIAIN/C# example found at
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but
Before I get flamed and down-voted without mercy, my company will not allow the
I'm building a webpart for a Sharepoint site that allows the user to enter

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.