Exception when sending larger amount of Data

Hi.

My Services fail when they transmit arrays larger than an certain size.
The size seams to be independent to the binding used.
The exception thrown is usually:

Unhandled Exception: System.ServiceModel.CommunicationException:
The server did not provide a meaningful reply; this might be caused by a contract mismatch, apremature session shutdown or an internal server error.

but i′ve seendifferentexceptions as well such like access violations and stuff if the array is even larger.

I′ve tested an can reproduce thisbehaviourfor basicHttp, wsHttp, netTcp and netPipeTcp Binging.

Code thatreproducesthebehaviour:

service:


[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]

publicinterfaceICalculator

{

[OperationContract]

string[] Add(int i);

}

// Service class which implements the service contract.

publicclassCalculatorService :ICalculator{

publicstring[] Add(int i){

string[] s =newstring[ i ];

for (int j = 0; i < j; i++){

s[j] ="1234567890";

}

return s;

}

}


client:


classClient{

staticvoid Main(){

// Create a proxy with given client endpoint configuration

using (CalculatorProxy proxy =newCalculatorProxy()){

while (true)

{

Console.WriteLine("i?");

int i =Convert.ToInt32(Console.ReadLine());

proxy.Add(i);

}

proxy.Close();

proxy.Dispose();

}

Console.WriteLine("Press <ENTER> to terminate client.");

Console.ReadLine();

}

}

Values above 1000 blow the service with an basic Binding and above 600 for a wsHttp Binding.

I′m running a Windwos Xp and the service is hosted in IIS but Console hosting is the same.

Is there a workaround to this issue?

[5701 byte] By [duke] at [2008-3-7]
# 1
There is a maxMessageSize attribute on the respective transport element of a binding. This should help.

ChristianWeyer at 2007-9-8 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

ups.... dumb me!

Thanks very much. Works great now.

duke at 2007-9-8 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified