0

既存の Web サイトに単純な WCF サービスを作成しました。私はそれをテストしましたが、すべてうまくいっているようです。サイトに https を要求するようにしましたが、ブラウザー (または任意のクライアント) を介して svc にアクセスすると、-

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

Stack trace is as follows:
[InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http].]
   System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +12907656
   System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost) +12905313
   System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +69
   System.ServiceModel.ServiceHostBase.ApplyConfiguration() +178
   Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost.ApplyConfiguration() +46
   System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +184
   System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +46
   System.ServiceModel.ServiceHost.InitializeDescription(Object singletonInstance, UriSchemeKeyedCollection baseAddresses) +43
   System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses) +247
   Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost..ctor(WSTrustServiceContract serviceContract, Uri[] baseAddresses) +72
   Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost..ctor(SecurityTokenServiceConfiguration securityTokenServiceConfiguration, Uri[] baseAddresses) +70
   Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +280
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1434
   System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598
4

1 に答える 1

0

HTTPS 対応バインディングが使用されるように、サービスの構成を変更する必要があります。次のブログ投稿を確認してください: http://weblogs.asp.net/srkirkland/archive/2008/02/20/wcf-bindings-needed-for-https.aspx

推奨される解決策は、web.config/app.config 内でカスタム バインディングを定義し、そのセキュリティ モードを に設定することTransportです。

<bindings>
   <webHttpBinding>
     <binding name="webBinding">
       <security mode="Transport" />
     </binding>
   </webHttpBinding>
</bindings>

次に、エンドポイントのバインディング構成でこのバインディングを使用します。

<endpoint address="" behaviorConfiguration="..." binding="webHttpBinding" bindingConfiguration="webBinding" contract="..." />
于 2013-06-10T08:25:24.553 に答える