ITPub博客

首页 > IT基础架构 > 网络安全 > WCF Security:authentication based on Username/Password - Part II

WCF Security:authentication based on Username/Password - Part II

原创 网络安全 作者:yuzhangqi 时间:2010-05-17 14:42:41 0 删除 编辑

Error Message

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

Incorrect Config

<behaviors>

<serviceBehaviors>

<behavior name="DataDistribution.ServiceImplementation.DataDistributionService_Behavior">

<serviceDebug includeExceptionDetailInFaults="true" />

<serviceMetadata httpGetEnabled="true" />

<serviceCredentials>

<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DataDistribution.ServiceImplementation.UserValidator, DataDistribution.ServiceImplementation" />

serviceCredentials>

behavior>

serviceBehaviors>

behaviors>

.

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="FileTransferTransportSecurity" name="HttpsEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService" />

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

service>

services>

Correct Config

<behaviors>

<serviceBehaviors>

<behavior name="DataDistribution.ServiceImplementation.DataDistributionService_Behavior">

<serviceDebug includeExceptionDetailInFaults="true" />

<serviceMetadata httpsGetEnabled="true" />

<serviceCredentials>

<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DataDistribution.ServiceImplementation.UserValidator, DataDistribution.ServiceImplementation" />

serviceCredentials>

behavior>

serviceBehaviors>

behaviors>

.

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="FileTransferTransportSecurity" name="HttpsEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService" />

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

service>

services>

Error Message

The provided URI scheme 'http' is invalid; expected 'https'.

Incorrect Config

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="basicHttpBinding" bindingConfiguration="FileTransferBinding" name="DefaultEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService"/>

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

service>

services>

<client>

<endpoint address="http://yuzhangqi01/DDS/DataDistribution.svc"

binding="basicHttpBinding" bindingConfiguration="DefaultEndpoint" contract="DataDistributionProxy.DataDistributionService" name="DefaultEndpoint" />

client>

Correct Config

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="basicHttpBinding" bindingConfiguration="FileTransferBinding" name="DefaultEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService"/>

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

service>

services>

<client>

<endpoint address="https://yuzhangqi01/DDS/DataDistribution.svc"

binding="basicHttpBinding" bindingConfiguration="DefaultEndpoint" contract="DataDistributionProxy.DataDistributionService" name="DefaultEndpoint" />

client>

Error Message

An error occurred while making the HTTP request to https://localhost/DDS/DataDistribution.svc. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.

Incorrect Config

Correct Config

Error Message

System.ServiceModel.ProtocolException: Content Type application/soap+xml; charset=utf-8 was not supported by service https://localhost/DDS/DataDistribution.svc. The client and service bindings may be mismatched.

Incorrect Config

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="basicHttpBinding" bindingConfiguration="FileTransferBinding" name="DefaultEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService"/>

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

service>

services>

<client>

<endpoint address="https://localhost/DDS/DataDistribution.svc"

binding="wsHttpBinding" bindingConfiguration="HttpsEndpoint" contract="DataDistributionProxy.DataDistributionService" name="HttpsEndpoint" />

client>

Correct Config

<services>

<service behaviorConfiguration="DataDistribution.ServiceImplementation.DataDistributionService_Behavior" name="DataDistribution.ServiceImplementation.DataDistributionService">

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="FileTransferTransportSecurity" name="HttpsEndpoint" bindingNamespace="urn:Ais.Sentry.Services.ServiceContracts" contract="DataDistribution.ServiceContracts.IDataDistributionService" />

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

service>

services>

<client>

<endpoint address="https://localhost/DDS/DataDistribution.svc"

binding="wsHttpBinding" bindingConfiguration="HttpsEndpoint" contract="DataDistributionProxy.DataDistributionService" name="HttpsEndpoint" />

client>

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13651903/viewspace-1033654/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-06-10

  • 博文量
    102
  • 访问量
    735909