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 に答える