Reputation: 4611
I have been developing a WCF REST service using webHttpBinding Session mode as required.But I am getting this error always "Contract requires Session, but Binding 'WebHttpBinding' doesn't support it or isn't configured properly to support it." Can any one tell what would be the reason for this ?
Upvotes: 3
Views: 2782
Reputation: 73253
Quote from the MSDN forums:
You cannot use WebHttpBinding for session based communication as it doesn't support the concept of sessions. I talked at length about sessions here - http://www.dotnetconsult.co.uk/weblog2/PermaLink,guid,af6e6325-2e30-42e3-acb9-57e1363fa51e.aspx.
WebHttpBinding doesn't support session for the same reason BasicHttpBinding doesn't. If you really must have sessions then you will have to use a binding that supports it. However, PerSession activation is only one way to maintain per client state. Can you not use another mechanism, say passing a session id to the service that you use to wire up your own concept of session?
Upvotes: 2