내 실용적으로 만들어 CustomBinding를 사용할 때 나는 다음과 같은 예외가 계속 추가 지원하지 않습니다.WCF CustomBing 예외 - AddressingNone는 WS-주소 헤더
주소 지정 버전 'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)'은 WS- 주소 지정 헤더 추가를 지원하지 않습니다.
이 문제를 해결할 방법이 있습니까?
private static CustomBinding CreateCustomBinding(bool useHttps)
{
BindingElement security;
BindingElement transport;
if (useHttps)
{
security = SecurityBindingElement.CreateSecureConversationBindingElement(
SecurityBindingElement.CreateUserNameOverTransportBindingElement());
transport = new HttpsTransportBindingElement
{
MaxBufferPoolSize = 2147483647,
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647,
};
}
else
{
security = SecurityBindingElement.CreateSecureConversationBindingElement(
SecurityBindingElement.CreateUserNameForSslBindingElement(true));
transport = new HttpTransportBindingElement
{
MaxBufferPoolSize = 2147483647,
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647,
};
}
var encoding = new MtomMessageEncodingBindingElement
{
MaxReadPoolSize = 64,
MaxWritePoolSize = 16,
MaxBufferSize = 2147483647,
MessageVersion = MessageVersion.Soap11,
WriteEncoding = System.Text.Encoding.UTF8
};
//var encoding = new TextMessageEncodingBindingElement();
var customBinding = new CustomBinding();
customBinding.Elements.Add(security);
customBinding.Elements.Add(encoding);
customBinding.Elements.Add(transport);
return customBinding;
}
왜 보안 대화를 사용하고 있습니까? 그것을 제거 할 때 작동합니까? –
@LadislavMrnka 아니요 제거 할 때도 작동하지 않습니다. – Tawani