TMG基本上是一個公司防火牆,阻止您的傳入請求,所以您首先必須與TMG進行協商,然後將您的請求發送給您的WCF服務。
下面是一個簡單結合我從the following MSDN blog entry了處理類似的問題:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://www.myservice.com/Service1.svc"
behaviorConfiguration="myEndpointBehaviour"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1"
contract="Client.IService1"
name="BasicHttpBinding_IService1" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="myEndpointBehaviour">
<clientCredentials>
<clientCertificate
storeName="My"
storeLocation="CurrentUser"
findValue="CN=WCF client cert 2" />
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
這種結合,如果你的服務沒有任何消息級安全啓用將已經這樣做了。
順便說一句,請確保您有訪問該服務的正確證書,登錄名和密碼可能意味着消息級別的安全性。