我有一個WCF問題。一直呆在這裏好幾天。因特網上的WCF錯誤只有
- 我有我的WCF服務和客戶端在Intranet上完美工作。
- 我在通過Internet公開的IIS服務器上部署了相同的服務/客戶端。這項服務,我能夠完全從我的工作站訪問,使用互聯網網站(.com地址)
- 但是,當使用未連接到我們網絡的計算機訪問相同的.com網站時,它給我帶來了可怕的「 HTTP請求未經授權,客戶端認證方案爲「協商」,從服務器收到的認證頭是「協商,NTLM」,當訪問服務時
其他信息:客戶端認證我。當客戶端訪問WCF服務時,出現錯誤。
客戶的Web.Config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="true"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://exposedoutside.com:80/site/myservice.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpoint"
contract="WFLServiceReference.IWorkflow" name="BasicHttpEndpoint" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<clientCredentials>
<windows allowedImpersonationLevel="Impersonation"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
我並不真的需要指定的端口。此外,我在代碼隱藏
Dim wcfService = New WCFServiceProxy.myserviceClient()
wcfService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
我錯過了什麼嗎?
預先感謝您。
謝謝您的回覆。但是,我想在客戶端應用程序上使用Windows身份驗證(我也嘗試啓用匿名,發生同樣的事情)。我也嘗試打開端點,它可以從未連接到網絡的計算機訪問。 – John 2011-02-07 02:47:55
對不起,您的文章有誤。啓用匿名時,您需要關閉所有其他選項。您可能需要轉而集成並使用摘要。如果連接的計算機位於相同的域中,則集成通常是。 – 2011-02-07 03:12:51