2013-02-10 28 views
1

我試圖在iis服務器上發佈wcf Web服務並使其使用Windows身份驗證。當我甚至嘗試發佈它時,我收到了一個錯誤,所以我沒有得到足夠的提示輸入用戶名。我有一個SSL證書,並希望使用SSL。已註冊的基址地址方案是[https]錯誤

這是我的錯誤:

[InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].] 
    System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16604769 
    System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +1082 
    System.ServiceModel.ServiceHostBase.ApplyConfiguration() +156 
    System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +215 
    System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +475 
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +43 
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +530 
    System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413 
    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50 
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172 

[ServiceActivationException: The service '/subservice/ISubService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]..] 
    System.Runtime.AsyncResult.End(IAsyncResult result) +901424 
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178638 
    System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +136 

我研究這一百次,但我有發佈服務的經驗非常少。我一直在與他們合作,一旦他們建立從未發表過。

這是我的web.config,我已經從其他的web.config其中一個發佈精細修改:

<?xml version="1.0"?> 

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> 

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
    <system.serviceModel> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpEndpointBinding"> 
      <security mode="Transport"> 
      <!-- Basic <security mode="Transport"> --> 
      <!-- To use Basic auth, just comment Windows and use this, but you need to configure basic in IIS as well --> 
      <!-- <transport clientCredentialType="Basic" /> --> 
      <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 

     <webHttpBinding> 
     <binding name="default"> 
      <security mode="Transport"> 
      <!-- Basic <security mode="Transport"> --> 
      <!-- To use Basic auth, just comment Windows and use this --> 
      <!-- <transport clientCredentialType="Basic" /> --> 
      <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpsGetEnabled="true" /> 
      <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="restBehavior">   
      <webHttp /> 
     </behavior> 
     </endpointBehaviors>  
    </behaviors> 

    <services> 
     <service name="subservice.ISubService"> 
     <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="subservice.ISubService"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 

     <endpoint address="rest" binding="webHttpsBinding" bindingConfiguration="default" behaviorConfiguration="restBehavior" contract="subservice.ISubService"> 
      <identity> 
      <dns value="localhost" />      
      </identity> 
     </endpoint> 

     <host> 
      <baseAddresses> 
      <add baseAddress = "https://[site]/subservice/" /> 
      </baseAddresses> 
     </host> 

     </service> 

    </services> 
    </system.serviceModel> 
</configuration> 

任何人都看到我在做什麼錯?

回答

相關問題