我發現自己需要找到使用HTTPS/SOAP的WCF綁定,並且必須是雙工的。我以前使用NetTcpBinding進行了編程,但綁定現在必須是HTTPS/SOAP。我做了一些研究,似乎沒有創建自己的CustomBinding是不可能的。WCF與SOAP HTTPS和雙工綁定
但是我有點迷失在做什麼(不太熟悉綁定和設置)。我似乎無法得到正確的綁定元素爲我所需要的:
public class CustomHttpsBinding : CustomBinding
{
public CustomHttpsBinding()
{
}
public override BindingElementCollection CreateBindingElements()
{
ReliableSessionBindingElement https = new ReliableSessionBindingElement();
SecurityBindingElement security = SecurityBindingElement.CreateCertificateOverTransportBindingElement();
CompositeDuplexBindingElement duplex = new CompositeDuplexBindingElement();
SslStreamSecurityBindingElement ssl = new SslStreamSecurityBindingElement();
MessageEncodingBindingElement encoding = new GZipMessageEncodingBindingElement((MessageEncodingBindingElement) new BinaryMessageEncodingBindingElement());
HttpsTransportBindingElement transport = new HttpsTransportBindingElement();
return new BindingElementCollection(new BindingElement[] { https, security, duplex, ssl, encoding, transport });
}
檢查了安全運輸要求,肥皂時說我的合同配置有需要的完整性和機密性的驗證模式它給了我一個無效的操作異常。但是運輸不能提供完整性和保密性。
看起來像我的HttpsTransportBindingElement不正確?我不確定。
感謝
編輯:
我還是設法得到WSDualHttpBinding在一個點上工作,但它似乎是HTTPS是不可能與它(以及其他的互聯網上說,它不該」 t甚至被使用)
我很好,有2個連接。是否可以調整wsDualHttpBinding(或使用類似的綁定元素)來使用https? – kyliod
爲什麼SSL是一項要求 - 使用WS-Security的郵件是安全的。什麼是SSL驅動程序? –
這是客戶端的事情。他們有一個客戶端/服務器之間需要https/soap的xml網關。 – kyliod