2016-09-16 5 views
0

IIS経由で展開されるWCFサービスアプリケーションがあります。C#WCFサービスアプリケーションのベースアドレスの問題

サービスの開発用URLはhttp://localhost:42543/Loyalty.svcですが、Webサーバーに公開されると、URLはhttp://ServerName:1066/Loyalty.svcになります。私は次のエラーを取得するURLに移動したときに

しかし、:

Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].

サイトのweb.configはここにある:私も基本的な輸送に関するセキュリティを使用しています

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsSecureBinding"> 
      <security mode="TransportWithMessageCredential"> 
      <message clientCredentialType="UserName"/> 
      <transport clientCredentialType="None" proxyCredentialType="None" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="default" name="IISService.Loyalty"> 
     <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsSecureBinding" name="secureService" contract="IISService.ILoyalty"/>  
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="default"> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
      <serviceCredentials> 
      <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="IISService.SecurityValidation, IISService"/> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <protocolMapping> 
     <add binding="basicHttpsBinding" scheme="https" /> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 

モデルはhttp://www.c-sharpcorner.com/UploadFile/manas1/implementing-username-password-security-in-wcf-service/で概説されています。

ご協力いただきありがとうございます。

+0

あなたはまだIISでサービスをホストしているサイトに対してhttpsを設定していませんか? – khlr

答えて

0

HTTPS用に設定されたそれぞれのサーバーがないようです。

IISには、HTTPSが設定されたポートバインディングが必要です。 https://msdn.microsoft.com/en-us/library/hh556232%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

CassiniはSSLをサポートしておらず、動作しません。 IIS Expressでは、Visual StudioでSSLを有効にする必要があります。 http://www.codeproject.com/Tips/723357/Enabling-SSL-with-IIS-Express-in-Visual-Studio

関連する問題