使用ssl(https)的帖子存在WCF问题
我目前有一个webHttp绑定WCF restful服务,它在http上工作得很好,由于我的webconfig设置,我可以发布大容量的帖子,现在我正在尝试通过https(ssl)使用它,现在我的工作很好,但我的帖子不工作,当文件大小超过一定数量时,它不工作,我想知道为什么会这样,因为我的webconfig指定了更大的大小,并且在http上运行良好,下面是我的相关webconfig。。有什么建议吗 谢谢使用ssl(https)的帖子存在WCF问题,wcf,ssl,post,https,webhttp,Wcf,Ssl,Post,Https,Webhttp,我目前有一个webHttp绑定WCF restful服务,它在http上工作得很好,由于我的webconfig设置,我可以发布大容量的帖子,现在我正在尝试通过https(ssl)使用它,现在我的工作很好,但我的帖子不工作,当文件大小超过一定数量时,它不工作,我想知道为什么会这样,因为我的webconfig指定了更大的大小,并且在http上运行良好,下面是我的相关webconfig。。有什么建议吗 谢谢 <system.serviceModel> <client> &l
<system.serviceModel>
<client>
<endpoint binding="webHttpBinding" bindingConfiguration="webHttp"
contract="PrimeStreamInfoServices.IService1" name="Client" />
</client>
<bindings>
<webHttpBinding>
<binding name="webHttp" maxBufferSize="15000000" maxBufferPoolSize="15000000"
maxReceivedMessageSize="15000000">
<readerQuotas maxDepth="15000000" maxStringContentLength="10000000"
maxArrayLength="15000000" maxBytesPerRead="15000000" maxNameTableCharCount="10000000" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="string" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior"
name="PrimeStreamInfoServices.Service1">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="webHttp" contract="PrimeStreamInfoServices.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PrimeStreamInfoServices.Service1Behavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<!--
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="TempCa" />
-->
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
</diagnostics>
如果要通过SSL使用webHttpBinding,则必须将绑定配置为使用传输安全性,如:
<security mode="Transport">
这为示例配置提供了一些详细信息,以处理以下错误:
找不到与http方案匹配的基址
具有绑定WebHttpBinding的终结点。注册基址方案
是[https]
博客中的示例配置:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="TestServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="TestService">
<endpoint address="" behaviorConfiguration="TestServiceAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="TestService" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport">
</security>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>