1

I have WCF service and I host it in my local Server (local machine) it work's fine but when I host it in server (internet) at that time it throws below error

An error occurred while receiving the HTTP response to http://www.xxxxxxxx.com/Services/WCFService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

This WCF service is for upload pdf files and also do operation as per uploaded pdf file.

problem is occurred when I uploaded pdf file and that file has more pages (approx above 500) at that time it take more execution time (approx 6 to 8 minutes).

if I upload pdf file that has 100 pages, 200 pages, 300 pages, at that time it works well.

NOTE : all the pdf file has below 5 MB size.

Darshan Faldu
  • 1,471
  • 2
  • 15
  • 32
  • Are you sure that it has nothing to do with the PDF file sizes? The limit on the content (# of pages) seems rather odd. – Vojtech B Aug 31 '15 at 12:21
  • @Vojtech : ya I am sure – Darshan Faldu Aug 31 '15 at 12:24
  • 1
    Sounds like your processing of large PDF files has a bug that only manifests in the server environment. Write a bunch of logs and see if you can tell where the service is failing. I'm going to guess it's memory, network, permissions, or perhaps some setting or code that you wrote that was only intended to work on your local machine but that got pushed to production. – Patrick87 Aug 31 '15 at 12:25

2 Answers2

1

It is possible that the processing takes too much time and the client time-outs before it is proceeded

<bindings>
  <basicHttpBinding>
    <binding name="IncreasedTimeout"
             sendTimeout="24:00:00">
    </binding>
  </basicHttpBinding>
</bindings>

Since uploading files to your localhost is instant - this timeout takes into account both server-processing and upload to your server.

Vojtech B
  • 2,837
  • 7
  • 31
  • 59
0

Yoy need to set Max Message Size and buffer size for WCF webhttp

<bindings>
  <webHttpBinding>
    <binding name="LargeWebBinding"
             maxBufferPoolSize="2147483647"
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647">
      <readerQuotas 
             maxArrayLength="2147483647" 
             maxNameTableCharCount="2147483647"
             maxStringContentLength="2147483647"
             maxDepth="2147483647"
             maxBytesPerRead="2147483647" />
    </binding>

You can try to use this:

<behaviors>
  <serviceBehaviors>
    <behavior name="LargeWebBehavior">
      <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="2147483647" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceTimeouts transactionTimeout="00:10:00" />
      <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100"
        maxConcurrentInstances="100" />
    </behavior>
  </serviceBehaviors>
</behaviors>
isxaker
  • 8,446
  • 12
  • 60
  • 87