I have WCF service consumed by AJAX client using SOAP 1.2
Web.config:
<endpoint address="" binding="wsHttpBinding"
contract="WcfService1.IService1" bindingConfiguration="wsHttpBin">
<wsHttpBinding>
<binding name="wsHttpBin">
<security mode="None"/>
</binding>
</wsHttpBinding>
From what I have read, I have to use <security mode="None"/>
since a service exposed with “wsHttpBinding” binding implements WS-Security of WS-* family of web service specifications. As the binding uses security, the request will be rejected since AJAX doesn't support the security context.
My WCF service behavior is defined with InstanceContextMode.PerSession
:
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple,
InstanceContextMode = InstanceContextMode.PerSession)]
but when I consume it, the service behave as PerCall and every call starts a new WCF instance instead of using the current instance.
Why InstanceContextMode.PerSession behave like PerCall when using wsHttpBinding?
What can I do?