无法通过https请求进行呼叫

时间:2013-10-07 07:49:00

标签: c# jquery wcf

我正在使用包含.svc文件并在https上作为rest api托管的网站。我的问题是: 我的网站SVCUTIL.exehttps://XXXXXXX但是当我用https请求它时,它失败了但是http请求正常工作。我不想使用SSL证书 感谢

这是我的webconfig设置:

  <serviceBehaviors>
    <behavior name="Mybehaviour">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
  <service behaviorConfiguration="Mybehaviour" name="PBUIService">
    <endpoint address="https://XXXXXXXXXXXXXXX" behaviorConfiguration="PBBehaviour" binding="webHttpBinding" bindingConfiguration="wsHttpBindingSettings" contract="PBUIService">
    </endpoint>
    <endpoint address="mex" binding="mexHttpsBinding"
 contract="IMetadataExchange" />
  </service>   
</services>

1 个答案:

答案 0 :(得分:0)

我添加了以下行,以使其与https一起使用:

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding name="webBinding">
                <security mode="Transport">
                </security>
            </binding>
        </webHttpBinding>           
    </bindings>