WCF Exists and partially working but for some calls returns “no endpoint listening - (404) Not Found.”

后端 未结 4 1738
不思量自难忘°
不思量自难忘° 2021-02-19 18:50

We have service that\'s working with small to large sets of data (document generation), and it\'s working fine for some calls, but for some specific requests (exact same method,

相关标签:
4条回答
  • 2021-02-19 19:24

    I found in addition to maxAllowedContentLength, the maxRequestLength on the server side in your WCF confgiration needs to be increased as well. I found that both values had to be increased for the exception to be resolved. In the .config for the WCF service server side make sure to add the following:

    <system.web>
      <!--Increase 'maxRequestLength' to needed value: 100mb (value is in kilobytes)-->
      <httpRuntime maxRequestLength="102400"/>
    </system.web>
    
    0 讨论(0)
  • 2021-02-19 19:33

    I found what was wrong using instructions on Troubleshooting Failed Requests Using Tracing in IIS 7 (very cool stuff btw)

    There, I saw that the error was in fact the 404.13, which easily led me to what's really wrong: Content length too large.

    In the end, the solution was to add this to web config:

    <configuration>
    ...
      <system.webServer>
        <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="204800000" />
          </requestFiltering>
        </security>
      </system.webServer>  
    </configuration>
    

    and, also, make sure that the default web site doesn't override it using:

    "%WINDIR%\System32\inetsrv\appcmd.exe" list config "Default web site" -section:requestFiltering

    0 讨论(0)
  • 2021-02-19 19:33

    If you are suspicious about the content and/or length of the message, you can try to intercept the calls using something like Fiddler - that should set your mind at ease on those points.

    0 讨论(0)
  • 2021-02-19 19:40

    Check the name attribute of the service element in the web.config:

    <configuration>
        <system.serviceModel>
            <services>
                <service name="...">
    

    The service name should contain the correct namespace+classname. You can find this in de code or by looking in the markup of the .svc file (or open the .svc file with notepad) for the Service="..." attribute.

    0 讨论(0)
提交回复
热议问题