我有一个 silverlight 应用程序,该应用程序通过 wcf (SSL/https) 连接到托管在 iis 上的公共服务。如果我在浏览器中启动应用程序,一切正常。一旦我以“退出浏览器模式”启动应用程序,它就不再工作了。我试图找出提琴手的问题,但只要提琴手正在运行,一切正常。我在互联网上找到了很多关于此的帖子,但没有任何效果。有什么想法吗?fiddler 到底做了什么并让它在 oob 中运行?
摘要: 1.“在浏览器中”一切正常 2.运行“浏览器外”时没有连接到公共服务 3.只要 Fiddler 运行,它就会运行“浏览器外”
以下是我如何进行连接的一些信息。
非常感谢您的帮助。
最好的祝福。马克
以下是我如何做所有事情的一些信息:
自签名证书是否可能与所有人有关?
客户端与公共服务的连接如下所示:
PublicServiceClient proxy;
BinaryMessageEncodingBindingElement binaryMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement();
HttpsTransportBindingElement httpsTransportBindingElement = new HttpsTransportBindingElement();
httpsTransportBindingElement.MaxBufferSize = int.MaxValue;
httpsTransportBindingElement.MaxReceivedMessageSize = int.MaxValue;
httpsTransportBindingElement.TransferMode = TransferMode.Buffered;
Binding binding = new CustomBinding(binaryMessageEncodingBindingElement, httpsTransportBindingElement);
binding.SendTimeout = new TimeSpan(0, 0, _WcfTimeout);
binding.ReceiveTimeout = new TimeSpan(0, 0, _WcfTimeout);
binding.OpenTimeout = new TimeSpan(0, 0, _WcfTimeout);
binding.CloseTimeout = new TimeSpan(0, 0, _WcfTimeout);
proxy = new PublicServiceClient(binding, new EndpointAddress("https://" + App.CurrentParameter.WcfDomain + "/PublicService.svc"));
绑定服务器端(web.config):
<binding name="Web.PublicService.customBinding0" sendTimeout="00:01:00" receiveTimeout="00:01:00" openTimeout="00:01:00" closeTimeout="00:01:00">
<binaryMessageEncoding maxReadPoolSize="2147483647" maxWritePoolSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binaryMessageEncoding>
<httpsTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" keepAliveEnabled="false"/>
</binding>
服务服务器端(web.config):
<service name="Web.PublicService">
<endpoint address="" binding="customBinding" bindingConfiguration="Web.PublicService.customBinding0" contract="Web.PublicService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>