WCF won't transmit more than about 8K

J

Jim Sneeringer

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.
 
J

Jim Sneeringer

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.
 
J

Jim Sneeringer

{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;
}
 
J

Jim Sneeringer

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top