【问题标题】:WCF problem with POSTs using ssl (https)使用 ssl (https) 的 POST 的 WCF 问题
【发布时间】:2011-01-16 05:59:14
【问题描述】:

我目前有一个 webHttp 绑定 WCF RESTful 服务,它在 http 上运行良好,由于我的 webconfig 设置,我可以制作大尺寸的帖子,现在我正在尝试通过 https (ssl) 使用它,现在我的工作正常,但是我的帖子没有,当文件大小超过一定数量时它不起作用,我想知道为什么会这样,因为我的 webconfig 指定了更大的大小并且它在 http 上运行良好,这是我的相关 webconfig .. 任何建议

谢谢

<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>

【问题讨论】:

    标签: wcf ssl post https webhttp


    【解决方案1】:

    如果您想通过 SSL 使用 webHttpBinding,那么您已将绑定配置为使用传输安全性,例如:

    <security mode="Transport"> 
    

    link 提供了一些详细信息以及示例配置以处理以下错误:

    找不到与方案 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-16
      • 2013-05-24
      • 1970-01-01
      • 2011-11-30
      • 1970-01-01
      • 2023-03-18
      • 2016-08-30
      相关资源
      最近更新 更多