尝试通过https设置WCF服务时出错

时间:2012-04-18 20:46:44

标签: .net wcf web-services web

我正在尝试通过https设置WCF服务。但是我一直收到错误:“无法找到与绑定BasicHttpBinding的端点的方案https匹配的基址。注册的基址方案是[http]。”

以下是我的web.config文件的内容:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    ...
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpsGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service name="SoftwareMyService.MyService" behaviorConfiguration="MyServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="https://........./" />
      </baseAddresses>
    </host>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="StreamedHttp" contract="SoftwareMyService.IMyService" />
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="StreamedHttp" transferMode="Streamed" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration> 

关于我做错的任何想法?

1 个答案:

答案 0 :(得分:1)

我希望这个shuold至少有一个MyService.svc值。

<endpoint address="" binding="basicHttpBinding" 
  bindingConfiguration="StreamedHttp" contract="SoftwareMyService.IMyService" />