【发布时间】:2016-09-02 16:52:20
【问题描述】:
我是 wcf 的新手并使用 wshttpbinding,但我想从服务客户端中删除用户名和密码(我必须通过), 我的客户代码是
RServiceClient serviceClient = new RServiceClient();
serviceClient.ClientCredentials.Windows.ClientCredential.UserName = "UserName";
serviceClient.ClientCredentials.Windows.ClientCredential.Password = "Password";
我不想传递这个用户名和密码。
我的客户端 app.config 是:
<binding name="WSHttpBinding_IRService"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32"
maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
rite now 服务托管在网络中。 service.config 或客户端应用程序 .config 是否有任何更改。 谷歌搜索后我的薄弱知识是改变应该是客户端,但我无法做到这一点。 :-(
注意:我的合同也需要会话。 提前谢谢。
【问题讨论】:
标签: wcf wshttpbinding wcf-authentication