WCF won't transmit more than about 8K

Discussion in 'ASP .Net Web Services' started by Jim Sneeringer, Oct 6, 2009.

  1. I have a Silverlight 3 application that uses WCF to access a SQL Server
    database. When a record field (a VARCHAR(MAX)) reaches about 8K, any WCF call
    that causes that field to be transmitted fails with "The remote server
    returned an error: NotFound" on the XxxCompleted callback. The server-size
    code is never called at all.

    If anyone knows how to fix this, I would love to know how. Otherwise, maybe
    this post will help someone diagnose a similar problem.
    Jim Sneeringer, Oct 6, 2009
    #1
    1. Advertising

  2. Thank you.

    I was not able to make it work by changing the config the way you said.
    Maybe it will help if I post it here:

    <system.serviceModel>
    <behaviors>
    <serviceBehaviors>
    <behavior name="sTickets.Web.TicketServiceBehavior">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    <!-- <dataContractSerializer maxItemsInObjectGraph="500000" />
    http://forums.silverlight.net/forums/t/21797.aspx -->
    </behavior>
    </serviceBehaviors>
    </behaviors>

    <services>
    <service behaviorConfiguration="sTickets.Web.TicketServiceBehavior"
    name="sTickets.Web.TicketService">
    <endpoint address="" binding="basicHttpBinding"
    contract="sTickets.Web.ITicketService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding"
    contract="IMetadataExchange" />
    </service>
    </services>

    <bindings>
    <basicHttpBinding>
    <binding name="SilverlightBinding" closeTimeout="01:00:00"
    openTimeout="01:00:00" maxBufferPoolSize="524288"
    maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"
    receiveTimeout="01:00:00" sendTimeout="01:00:00">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="None" />
    </security>
    <readerQuotas maxArrayLength="2147483647"
    maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"
    maxStringContentLength="2147483647" maxDepth="2147483647" />
    </binding>
    </basicHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
    <!--<baseAddressPrefixFilters>
    <add prefix="http://t.snee.us"/>
    </baseAddressPrefixFilters>-->
    </serviceHostingEnvironment>
    </system.serviceModel>

    Also, I found in the client project an autogenerated file
    configuration91.svcinfo, which contained this:

    <property path="/readerQuotas/maxStringContentLength"
    isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32,
    mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <serializedValue>0</serializedValue>
    </property>

    I change the 0 to 2147483647, but it still fails.
    Jim Sneeringer, Oct 6, 2009
    #2
    1. Advertising

  3. {System.ServiceModel.CommunicationException: The remote server returned an
    error: NotFound. ---> System.Net.WebException: The remote server returned an
    error: NotFound. ---> System.Net.WebException: The remote server returned an
    error: NotFound.
    at
    System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult
    asyncResult)
    at
    System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
    at
    System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object
    sendState)
    --- End of inner exception stack trace ---
    at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback
    beginMethod, Object state)
    at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult
    asyncResult)
    at
    System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
    --- End of inner exception stack trace ---
    at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at
    System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
    at System.ServiceModel.Channels.ServiceChannel.EndCall(String action,
    Object[] outs, IAsyncResult result)
    at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String
    methodName, Object[] args, IAsyncResult result)
    at
    sTickets.TicketServiceReference.TicketServiceClient.TicketServiceClientChannel.EndTicket_Save(IAsyncResult result)}

    Here's where it died. The service code was never called.

    public
    System.Collections.ObjectModel.ObservableCollection<sTickets.TicketServiceReference.Ticket> EndTicket_Save(System.IAsyncResult result) {
    object[] _args = new object[0];

    System.Collections.ObjectModel.ObservableCollection<sTickets.TicketServiceReference.Ticket>
    _result =
    ((System.Collections.ObjectModel.ObservableCollection<sTickets.TicketServiceReference.Ticket>)(base.EndInvoke("Ticket_Save", _args, result)));
    return _result;
    }
    Jim Sneeringer, Oct 6, 2009
    #3
  4. I'll check it out. Thank you so much for your help.

    BTW, I'm pretty sure it's a size problem, because if I reduce the size of
    the data, it starts to work.
    Jim Sneeringer, Oct 7, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark McKay
    Replies:
    1
    Views:
    555
    Andrew Thompson
    Oct 8, 2004
  2. Simon
    Replies:
    0
    Views:
    996
    Simon
    Oct 13, 2009
  3. Cindy Lee
    Replies:
    1
    Views:
    2,075
    Mr. Arnold
    Mar 19, 2010
  4. Steven D'Aprano
    Replies:
    0
    Views:
    79
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    73
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page