有没有办法使用 WS2007FederationHttpBinding 绑定,但生成 SOAP 1.1 请求信封?我需要使用 WS2007FederationHttpBinding 使用从 STS 服务获取的不记名令牌进行身份验证。这是我的绑定:
private static Binding GetWS2007FederationHttpBinding()
{
var binding = new WS2007FederationHttpBinding(
WSFederationHttpSecurityMode.TransportWithMessageCredential);
binding.Security.Message.NegotiateServiceCredential = false;
binding.Security.Message.EstablishSecurityContext = false;
binding.Security.Message.IssuedKeyType = SecurityKeyType.BearerKey;
//binding.MessageVersion.Addressing = AddressingVersion.WSAddressingAugust2004;
//binding.MessageVersion.Envelope = EnvelopeVersion.Soap11;
// or
//binding.MessageVersion = MessageVersion.Soap11WSAddressingAugust2004;
return binding;
}
但我不能改变binding.MessageVersion
,因为它是一个只读属性?