0

我正在尝试使用 wshttpbinding 创建 wcf 服务,但是每当我更改安全模式时,无论我如何使用 google 的示例对其进行修改,它总是会出错

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <serviceActivations>
    <add relativeAddress="General.svc" service="SMJ.Services.GeneralService" />
  </serviceActivations>
</serviceHostingEnvironment>
<bindings>
  <wsHttpBinding>
    <binding closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
   maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
      messageEncoding="Text" textEncoding="utf-8" 
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16348"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="SMJ.Services.GeneralService" behaviorConfiguration="ServiceBehaviors" >
    <endpoint contract="SMJ.Services.IGeneralService" binding="wsHttpBinding"></endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors >
    <behavior name="ServiceBehaviors"  >
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

当我将安全模式更改为另一种时,它将显示此错误 找不到与具有绑定 WSHttpBinding 的端点的方案 https 匹配的基地址。注册的基地址方案是 [http]。

服务器是 IIS 7,但问题是我正在开发中

请帮我

4

1 回答 1

0

好的,我找到了使用 IIS Express 的解决方案,并在属性窗口的 Web 项目中将 SSL Enabled 设置为 true。谢谢你的建议

于 2012-12-07T05:35:25.010 回答