I have a WCF service with a method that accepts an array (of type Frame). Each element in the array includes an small array of elements (of type Shape) again where each element has two attributes. So, everything works fine. But now I have a message from the client to the server that consists of an array with 28 frames. With Wireshark I see, that the message is transmitted correctly. But in my .NET WCF service I don't get the call. But why? The bindings and reader-quotas are set to 5MB which should be enough.
The binding configuration:
<bindings>
<webHttpBinding>
<binding name="default" transferMode="Streamed" maxReceivedMessageSize="5000000" maxBufferSize="5000000" maxBufferPoolSize="5000000">
<readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" />
</binding>
</webHttpBinding>
</bindings>
The WCF service definition:
[ServiceContract]
public interface IEditor
{
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/WriteFrames", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
void WriteFrames(Frame[] frames, int animationSpeed);
}
Type descriptions:
- Type: Frame
- Array: Shapes
- Shape 1
- Shape 2
- ...
- Array: Shapes
- Type: Shape
- Array: Points
- Point 1
- Point 2
- ...
- Array: Points
- Type: Point
- X
- Y
The service is hosted as a singleton. See static Create method.
sealed class EditorHost : ServiceHost
{
public EditorHost()
: base(typeof(Editor))
{
}
public EditorHost(params Uri[] baseAddresses)
: base(typeof(Editor), baseAddresses)
{
}
public EditorHost(Editor singleton, params Uri[] baseAddresses)
: base(singleton, baseAddresses)
{
}
internal static EditorHost Create(out Editor editor, int port = 8732)
{
var uri = new Uri(string.Format("http://localhost:{0}/", port));
editor = new Editor();
var host = new EditorHost(editor, uri);
return host;
}
}