2016-11-19 80 views
0

我得到的錯誤,而使用wsHtpBinding幫助頁面得到錯誤和服務還沒有工作WCF服務的wsHttpBinding

幫助頁面錯誤創建WCF服務:

的資源不能被發現。說明:HTTP 404.您正在查找的資源(或其某個依賴項)可能已被刪除,名稱已更改或暫時不可用。請檢查以下網址並確保它拼寫正確。 http://localhost:80/Service1.svc/help

我以前的工作WsHttpBinding的項目的web.config,但它不是現在的工作:

的web.config

<?xml version="1.0"?> 
<configuration> 
    <appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
    </appSettings> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" executionTimeout="3600" maxRequestLength="10000000"/> 
    <customErrors mode="Off" /> 
    </system.web> 
    <system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="MyServiceTypeBehaviors"> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
     </behavior> 
     <behavior name=""> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <bindings> 
     <wsHttpBinding > 
     <binding name="MyBasicwsHttpBinding"> 
      <security mode="None"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="MyServiceTypeBehaviors" name="WcfService1.Service1"> 
     <endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="MyBasicwsHttpBinding" name="WcfService1.Service1" contract="WcfService1.IService1"/> 
     </service> 
    </services> 
    <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    <directoryBrowse enabled="true"/> 
    </system.webServer> 
</configuration> 

回答

0

就我而言,我發現一個微軟的IIS過濾模塊Url Scan 3.1安裝在IIS /網站上,它有自己的限制,根據內容大小拒絕傳入請求並返回「404未找到頁面」。

通過將MaxAllowedContentLength設置爲所需的值,可以更新%windir%\System32\inetsrv\urlscan\UrlScan.ini文件中的限制。

例如,以下將允許高達300 MB的請求

MaxAllowedContentLength = 314572800

相關問題