public void GetPropertyMessageVersion() { var be = new HttpTransportBindingElement(); var mv = be.GetProperty <MessageVersion> (new BindingContext(new CustomBinding(), empty_params)); Assert.AreEqual(MessageVersion.Soap12WSAddressing10, mv, "#1"); }
public void GetPrpertyBindingDeliveryCapabilities() { var be = new HttpTransportBindingElement(); var dc = be.GetProperty <IBindingDeliveryCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsFalse(dc.AssuresOrderedDelivery, "#1"); Assert.IsFalse(dc.QueuedDelivery, "#2"); }
public void GetPrpertySecurityCapabilities() { var be = new HttpTransportBindingElement(); var sec = be.GetProperty <ISecurityCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsNotNull(sec, "#1.1"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#1.2"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#1.3"); Assert.IsFalse(sec.SupportsClientAuthentication, "#1.4"); Assert.IsFalse(sec.SupportsClientWindowsIdentity, "#1.5"); Assert.IsFalse(sec.SupportsServerAuthentication, "#1.6"); be = new HttpTransportBindingElement(); be.AuthenticationScheme = AuthenticationSchemes.Negotiate; sec = be.GetProperty <ISecurityCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsNotNull(sec, "#2.1"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#2.2"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#2.3"); Assert.IsTrue(sec.SupportsClientAuthentication, "#2.4"); Assert.IsTrue(sec.SupportsClientWindowsIdentity, "#2.5"); Assert.IsTrue(sec.SupportsServerAuthentication, "#2.6"); // almost the same, only differ at SupportsServerAuth be = new HttpTransportBindingElement(); be.AuthenticationScheme = AuthenticationSchemes.Ntlm; sec = be.GetProperty <ISecurityCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsNotNull(sec, "#3.1"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#3.2"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#3.3"); Assert.IsTrue(sec.SupportsClientAuthentication, "#3.4"); Assert.IsTrue(sec.SupportsClientWindowsIdentity, "#3.5"); Assert.IsFalse(sec.SupportsServerAuthentication, "#3.6"); be = new HttpTransportBindingElement(); be.AuthenticationScheme = AuthenticationSchemes.Basic; sec = be.GetProperty <ISecurityCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsNotNull(sec, "#4.1"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#4.2"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#4.3"); Assert.IsTrue(sec.SupportsClientAuthentication, "#4.4"); Assert.IsTrue(sec.SupportsClientWindowsIdentity, "#4.5"); Assert.IsFalse(sec.SupportsServerAuthentication, "#4.6"); be = new HttpTransportBindingElement(); be.AuthenticationScheme = AuthenticationSchemes.Digest; sec = be.GetProperty <ISecurityCapabilities> (new BindingContext(new CustomBinding(), empty_params)); Assert.IsNotNull(sec, "#5.1"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#5.2"); Assert.AreEqual(ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#5.3"); Assert.IsTrue(sec.SupportsClientAuthentication, "#5.4"); Assert.IsTrue(sec.SupportsClientWindowsIdentity, "#5.5"); Assert.IsFalse(sec.SupportsServerAuthentication, "#5.6"); }
public static void Snippet20() { // <Snippet20> CustomBinding binding = new CustomBinding(); HttpTransportBindingElement element = new HttpTransportBindingElement(); BindingParameterCollection parameters = new BindingParameterCollection(); parameters.Add(new ServiceCredentials()); Uri baseAddress = new Uri("http://localhost:8000/ChannelApp"); String relAddress = "http://localhost:8000/ChannelApp/service"; BindingContext context = new BindingContext(binding, parameters, baseAddress, relAddress, ListenUriMode.Explicit); ServiceCredentials serviceCredentials = element.GetProperty <ServiceCredentials>(context); // </Snippet20> }
public void GetPrpertySecurityCapabilities () { var be = new HttpTransportBindingElement (); var sec = be.GetProperty<ISecurityCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsNotNull (sec, "#1.1"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#1.2"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#1.3"); Assert.IsFalse (sec.SupportsClientAuthentication, "#1.4"); Assert.IsFalse (sec.SupportsClientWindowsIdentity, "#1.5"); Assert.IsFalse (sec.SupportsServerAuthentication , "#1.6"); be = new HttpTransportBindingElement (); be.AuthenticationScheme = AuthenticationSchemes.Negotiate; sec = be.GetProperty<ISecurityCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsNotNull (sec, "#2.1"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#2.2"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#2.3"); Assert.IsTrue (sec.SupportsClientAuthentication, "#2.4"); Assert.IsTrue (sec.SupportsClientWindowsIdentity, "#2.5"); Assert.IsTrue (sec.SupportsServerAuthentication , "#2.6"); // almost the same, only differ at SupportsServerAuth be = new HttpTransportBindingElement (); be.AuthenticationScheme = AuthenticationSchemes.Ntlm; sec = be.GetProperty<ISecurityCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsNotNull (sec, "#3.1"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#3.2"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#3.3"); Assert.IsTrue (sec.SupportsClientAuthentication, "#3.4"); Assert.IsTrue (sec.SupportsClientWindowsIdentity, "#3.5"); Assert.IsFalse (sec.SupportsServerAuthentication , "#3.6"); be = new HttpTransportBindingElement (); be.AuthenticationScheme = AuthenticationSchemes.Basic; sec = be.GetProperty<ISecurityCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsNotNull (sec, "#4.1"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#4.2"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#4.3"); Assert.IsTrue (sec.SupportsClientAuthentication, "#4.4"); Assert.IsTrue (sec.SupportsClientWindowsIdentity, "#4.5"); Assert.IsFalse (sec.SupportsServerAuthentication , "#4.6"); be = new HttpTransportBindingElement (); be.AuthenticationScheme = AuthenticationSchemes.Digest; sec = be.GetProperty<ISecurityCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsNotNull (sec, "#5.1"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedRequestProtectionLevel, "#5.2"); Assert.AreEqual (ProtectionLevel.None, sec.SupportedResponseProtectionLevel, "#5.3"); Assert.IsTrue (sec.SupportsClientAuthentication, "#5.4"); Assert.IsTrue (sec.SupportsClientWindowsIdentity, "#5.5"); Assert.IsFalse (sec.SupportsServerAuthentication , "#5.6"); }
public void GetPrpertyBindingDeliveryCapabilities () { var be = new HttpTransportBindingElement (); var dc = be.GetProperty<IBindingDeliveryCapabilities> (new BindingContext (new CustomBinding (), empty_params)); Assert.IsFalse (dc.AssuresOrderedDelivery, "#1"); Assert.IsFalse (dc.QueuedDelivery, "#2"); }
public void GetPropertyMessageVersion () { var be = new HttpTransportBindingElement (); var mv = be.GetProperty<MessageVersion> (new BindingContext (new CustomBinding (), empty_params)); Assert.AreEqual (MessageVersion.Soap12WSAddressing10, mv, "#1"); }