找不到与绑定 WSHttpBinding 的端点的方案 http 匹配的基地址,还没有解决方案
Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding with NO SOLUTION YET
我有一个 WCF 服务(具有身份验证和授权)托管在 IIS 7.5 中,使用 Windows Server 2008 R2 中的 SSL 认证。我在此服务器中 运行 WCF 应用程序 Visual Studio 时出错。 WCF 测试客户端给了我这个错误:找不到与绑定 WSHttpBinding 的端点的方案 https 匹配的基址。但它在 IIS 中工作。而且我可以在我的 Web 应用程序中毫无错误地部署我的 WCF 服务。所有的建议都试过了,没有解决方案。
我的web.config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None"/>
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="TBBWS.TBBService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding"
name="wsHttpEndpoint" contract="TBBWS.ITBBService" />
<endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
name="MexHttpsBindingEndpoint" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="TBBWS.CustomValidation, App_Code" />
</serviceCredentials>
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="TBBWS.CustomAuthorizationPolicy, App_Code" />
</authorizationPolicies>
</serviceAuthorization>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<remove scheme="http" />
<add binding="wsHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
有什么建议吗?
好的,我知道了。有相同问题需要帮助的朋友:
1)我在 serviceCredentials 标签下添加了 <serviceCertificate storeLocation="LocalMachine" storeName="My" findValue="bla bla bla" x509FindType="FindByThumbprint" />
。
2)我定义了2个绑定。 http 和 https。我删除了 http 绑定。
谢谢...
我有一个 WCF 服务(具有身份验证和授权)托管在 IIS 7.5 中,使用 Windows Server 2008 R2 中的 SSL 认证。我在此服务器中 运行 WCF 应用程序 Visual Studio 时出错。 WCF 测试客户端给了我这个错误:找不到与绑定 WSHttpBinding 的端点的方案 https 匹配的基址。但它在 IIS 中工作。而且我可以在我的 Web 应用程序中毫无错误地部署我的 WCF 服务。所有的建议都试过了,没有解决方案。
我的web.config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None"/>
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="TBBWS.TBBService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding"
name="wsHttpEndpoint" contract="TBBWS.ITBBService" />
<endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
name="MexHttpsBindingEndpoint" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="TBBWS.CustomValidation, App_Code" />
</serviceCredentials>
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="TBBWS.CustomAuthorizationPolicy, App_Code" />
</authorizationPolicies>
</serviceAuthorization>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<remove scheme="http" />
<add binding="wsHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
有什么建议吗?
好的,我知道了。有相同问题需要帮助的朋友:
1)我在 serviceCredentials 标签下添加了 <serviceCertificate storeLocation="LocalMachine" storeName="My" findValue="bla bla bla" x509FindType="FindByThumbprint" />
。
2)我定义了2个绑定。 http 和 https。我删除了 http 绑定。
谢谢...