我有一个WCF服务,需要使用basicHttpBinding托管使用SSL。因此,我的团队安装了一个启用了匿名身份验证的SSL证书,并在IIS中给出了一个硬编码的用户名和密码。我试着给这个绑定
<binding name="SecurityByTransport">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding> 但是它仍然不能工作。我收到这样的错误:“找不到与绑定了BasicHttpBinding的端点的方案http匹配的基地址。注册的基地址方案是https。”
ServiceModel部分:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<customBinding>
<binding name="netTcp">
<binaryMessageEncoding>
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="64" />
</binaryMessageEncoding>
<security authenticationMode="UserNameOverTransport" />
<windowsStreamSecurity />
<tcpTransport portSharingEnabled="true" maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
<basicHttpBinding>
<binding name="Https">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name ="Https">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Asi.Soa.ServiceModelEx.NullUserNamePasswordValidator, Asi.Soa.ServiceModelEx" />
<clientCertificate>
<authentication certificateValidationMode="None" />
</clientCertificate>
</serviceCredentials>
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="Asi.Soa.ServiceModelEx.ClaimsAuthorizationPolicy, Asi.Soa.ServiceModelEx" />
</authorizationPolicies>
</serviceAuthorization>
<exceptionShielding/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="SoapBehavior">
</behavior>
<behavior name="RestBehavior">
</behavior>
<behavior name="AjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="Asi.Soa.Core.Services.EntityService" >
<endpoint address="https://10.42.150.122/imis15/EntityService.svc" binding="basicHttpBinding" contract="Asi.Soa.Core.ServiceContracts.IEntityService"
bindingConfiguration="Https" />
</service>
</services>
任何帮助都将不胜感激。
谢谢
发布于 2012-06-27 17:00:01
尝试添加到服务行为设置
<serviceMetadata httpsGetEnabled="true"/>此外,您还应该检查endpoind是否有设置
bindingConfiguration="SecurityByTransport"发布于 2012-06-27 20:36:27
如果您在IIS中承载服务,请尝试从站点绑定中删除http绑定。
HTH
发布于 2012-06-28 00:52:03
由于您使用的是IIS上的web服务,因此考虑到您使用的是SSL证书,请对其使用HTTPS绑定。
https://stackoverflow.com/questions/11222101
复制相似问题