- added EnableUnsecuredResponse flag

git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1083214 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/webservices/webservices.cs b/DotCMIS/binding/webservices/webservices.cs
index 5b0d813..5842fa7 100644
--- a/DotCMIS/binding/webservices/webservices.cs
+++ b/DotCMIS/binding/webservices/webservices.cs
@@ -27,6 +27,7 @@
 using DotCMIS.Exceptions;

 using DotCMIS.Enums;

 using System.ServiceModel.Channels;

+using System.Reflection;

 

 namespace DotCMIS.Binding.WebServices

 {

@@ -231,7 +232,18 @@
 

                 SecurityBindingElement securityElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();

                 securityElement.SecurityHeaderLayout = SecurityHeaderLayout.LaxTimestampFirst;

-                //securityElement.IncludeTimestamp = false;

+

+                string enableUnsecuredResponseFlag = session.GetValue(SessionParameter.EnableUnsecuredResponse) as string;

+                if (enableUnsecuredResponseFlag != null && enableUnsecuredResponseFlag.ToLower().Equals("true"))

+                {

+                    securityElement.EnableUnsecuredResponse = true;

+                    PropertyInfo eur = securityElement.GetType().GetProperty("EnableUnsecuredResponse");

+                    if (eur != null)

+                    {

+                        eur.GetSetMethod().Invoke(securityElement, new object[] { true });

+                    }

+                }

+

                 elements.Add(securityElement);

 

                 MtomMessageEncodingBindingElement mtomElement = new MtomMessageEncodingBindingElement();

diff --git a/DotCMIS/const.cs b/DotCMIS/const.cs
index 0555cbd..7ee2a2e 100644
--- a/DotCMIS/const.cs
+++ b/DotCMIS/const.cs
@@ -51,6 +51,7 @@
         public const string WebServicesAclService = "org.apache.chemistry.dotcmis.binding.webservices.ACLService";

 

         public const string WebServicesWCFBinding = "org.apache.chemistry.dotcmis.binding.webservices.wcfbinding";

+        public const string EnableUnsecuredResponse = "org.apache.chemistry.dotcmis.binding.webservices.enableUnsecuredResponse"; // requires hotfix 971493 or the .NET framework 4 

 

         // authentication provider

         public const string AuthenticationProviderClass = "org.apache.chemistry.dotcmis.binding.auth.classname";