具有自定义绑定的 Silverlight WCF 安全性
我有一个 silverlight 应用程序调用许多 WCF 服务。 silver light 客户端的典型绑定如下所示:
<basicHttpBinding>
<binding name="ClientBindingName" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="TransportCredentialOnly" />
</binding>
</basicHttpBinding>
与服务器绑定配对如下:
<basicHttpBinding>
<binding name="ServerbindingName" sendTimeout="00:02:00">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
对于其中一项服务,我需要自定义绑定,但我无法找到不会导致403 错误。
我能为客户端提供的最好方案是:
<customBinding>
<binding name="CustomBinding_IZipService_StreamedResponse" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
transferMode="StreamedResponse" />
</binding>
</customBinding>
对于服务:
<customBinding>
<binding name="FS.SUV.Services.ZipService.customBinding"
receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding>
<readerQuotas maxStringContentLength="524288000"/>
</binaryMessageEncoding>
<httpTransport transferMode="StreamedResponse"
maxBufferSize="524288000"
maxBufferPoolSize="524288000"
maxReceivedMessageSize="524288000" />
<security authenticationMode="SecureConversation" requireSecurityContextCancellation="true">
<secureConversationBootstrap authenticationMode="UserNameOverTransport" />
</security>
</binding>
</customBinding>
我怎样才能获得自定义绑定,以便通过 Windows 身份验证与 silverlight 配合良好?
I have a silverlight app that calls a number of WCF services. The typical bindings for the silver light client looks like this:
<basicHttpBinding>
<binding name="ClientBindingName" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="TransportCredentialOnly" />
</binding>
</basicHttpBinding>
and that's paired with the server bindings like this:
<basicHttpBinding>
<binding name="ServerbindingName" sendTimeout="00:02:00">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
For one of the services I require a custom binding, but I am unable to find a combination of bindings that don't result in a 403 error.
The best I can come up with for the client is:
<customBinding>
<binding name="CustomBinding_IZipService_StreamedResponse" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
transferMode="StreamedResponse" />
</binding>
</customBinding>
and for the service:
<customBinding>
<binding name="FS.SUV.Services.ZipService.customBinding"
receiveTimeout="00:10:00" sendTimeout="00:10:00">
<binaryMessageEncoding>
<readerQuotas maxStringContentLength="524288000"/>
</binaryMessageEncoding>
<httpTransport transferMode="StreamedResponse"
maxBufferSize="524288000"
maxBufferPoolSize="524288000"
maxReceivedMessageSize="524288000" />
<security authenticationMode="SecureConversation" requireSecurityContextCancellation="true">
<secureConversationBootstrap authenticationMode="UserNameOverTransport" />
</security>
</binding>
</customBinding>
how can I get custom bindings to play nice with silverlight over windows authentication?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明我想得太复杂了。客户端绑定很好,因此保留为:
服务器绑定需要这样设置:
我设法通过使用这一代工具来获得正确的绑定: http://webservices20.cloudapp.net/default.aspx
It turns out I was trying to be too complex. The client binding was fine and so was left as:
and the server binding needed to be set like this:
I managed to get the binding right by using this gen of a tool: http://webservices20.cloudapp.net/default.aspx
您的配置不正确。在两侧尝试此操作(并根据需要修改读者配额和消息大小限制):
Your configuration is incorrect. Try this on both sides (and modify reader quotas and message size limits as you need):