2014-02-22 17 views
1
<?xml version="1.0"?> 

<configuration> 
    <system.web> 
    <compilation debug="false" targetFramework="4.0"></compilation> 
    </system.web> 
    <system.serviceModel> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name=""> 
      <webHttp helpEnabled="true" faultExceptionEnabled="true" /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name=""> 
      <serviceAuthorization serviceAuthorizationManagerType="WcfRestService.Infrastructure.BasicAuthenticationManager, WcfRestService" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
      <serviceMetadata httpsGetEnabled="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <webHttpBinding> 
     <binding name=""> 
      <security mode="Transport" /> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    </system.serviceModel> 

    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <add name="UrlRoutingModule" 
      type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

    </modules> 
    <handlers> 
     <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" 
      type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    </handlers> 
    </system.webServer> 
</configuration> 

找不到匹配方案HTTPS在 端點結合的WebHttpBinding的基址。註冊的基地址方案。 我從Visual Studio運行它如何在本地運行它。 是[http]。WCF BaseAddress問題和EndPoint發行不工作

+1

是否有任何理由在您的標記中沒有​​標記? – Zack

+1

@Zack - WCF 4.0+中不需要端點。如果未明確定義端點,則將使用具有'basicHttpBinding'的默認端點。 – Tim

+0

標籤怎麼樣?比如system.serviceModel/services/service/host/baseAddresses/add @ baseAddress =「https:// localhost:8080/ServiceName」 – Zack

回答

2

你可以試試明確映射webHttpBindinghttps協議在您的配置文件,如:

<protocolMapping> 
    <add scheme="https" binding="webHttpBinding" /> 
</protocolMapping> 

這正好在你的<system.serviceModel>部分。這將告訴服務默認使用webHttpBinding請求https(IIRC,basicHttpsBinding是WCF默認的https)。

+0

我已將項目上傳到http://speedy.sh/7Q68t /WcfRestService.rar請進行更改以運行項目並上傳它。謝謝 – MSalmanSabir

+0

請幫助我嗎? – MSalmanSabir