我有一个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