4

トランスポートセキュリティのみを使用してWCFサービスを作成しようとしているので、SSLは必要ありません。

実行すると、次のエラーメッセージが表示され続けます。

Could not find a base address that matches scheme https for the endpoint with binding 
BasicHttpBinding.

私のWeb.configファイルは次のようになります。

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>      
        <binding name="Binding1">
          <security mode="Transport">
            <transport clientCredentialType="Basic"></transport>
          </security>
        </binding>      
      </basicHttpBinding>

    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="AutoSenderWCFService.AutoSenderService">        
        <endpoint binding="basicHttpBinding"  bindingConfiguration="Binding1"
          contract="AutoSenderWCFService.IService1" />        
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceCredentials>

            <userNameAuthentication userNamePasswordValidationMode="Custom"
              customUserNamePasswordValidatorType="AutoSenderWCFService.MyValidator, AutoSenderWCFService"/>

          </serviceCredentials>

          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>
4

3 に答える 3

6

トランスポートセキュリティとは、SSLを使用してチャネルを保護することを意味するため、証明書が必要になります。

SSLを使用したくないが、チャネルを介してユーザー名パスワードを渡したい場合は、ClearUsernameBindingを使用して、チャネルを介してユーザー名パスワードをクリアテキストで送信できます。

注:これは、セキュリティを提供するファイアウォールの背後のように、クライアントとサーバーチャネルが安全であると確信している場合にのみ使用してください。

于 2012-05-17T08:40:58.777 に答える
1

そこにアドレスが表示されません-エンドポイントにアドレスを追加してください。問題ないはずです

それで:

<endpoint binding="basicHttpBinding" address="https://address" bindingConfiguration="Binding1" 
          contract="AutoSenderWCFService.IService1" />  
于 2012-05-17T07:04:23.620 に答える
1

私の場合、SSLを使用せずにテストサーバーでwcfWebサービスのセットアップをテストしようとしていました。セキュリティモードをnoneに変更すると、機能し始めました。

于 2013-03-12T19:52:14.457 に答える