2015-02-06 46 views
2

我有一個使用Windows Server 2008 R2中的SSL證書在IIS 7.5中託管的WCF服務(具有身份驗證和授權)。在此服務器中使用Visual Studio運行WCF應用程序時出現錯誤。 WCF測試客戶端給了我這個錯誤:無法找到與具有綁定WSHttpBinding的端點匹配scheme https的基地址。但它在IIS中工作。我可以在我的Web應用程序中部署我的WCF服務,沒有任何錯誤。所有的建議都經過嘗試,沒有解決辦法。無法找到與綁定WSHttpBinding的端點的方案http相匹配的基地址無解決方法是

我的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" /> 

它有什麼建議?

回答

0

好的,我明白了。對於那些誰需要,因爲同樣的問題的幫助:

1)我下serviceCredentials標籤添加<serviceCertificate storeLocation="LocalMachine" storeName="My" findValue="bla bla bla" x509FindType="FindByThumbprint" />

2)我定義了2個綁定。 http和https。我刪除了http綁定。

感謝反正...

相關問題