Loosing Bytes in byte[][] while using WSE3 without MTOM
-
Hello, I wrote a little Server and run it under Win 2003 and Win 2008, [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)] [WebService(Namespace="http://www.pyramid.de", Description="Pyramid")] public class WormRaid : System.Web.Services.WebService { [WebMethod(MessageName="WriteBytes")] public long WriteBytes (byte[][] memData) { return (memData[0].Length + memData[1].Length); } } Now my problem is that the second byte array in a byte[][] is always received as 0 bytes, when the first byte[] length is a odd multiple of 1024 (1024, 3072 or ...). This error occurs only without MTOM, with MTOM everything works fine (see attached code). The error is probably in the server side because the same error can be produced with a GSoap Client (also without MTOM). Here my Client Code: internal static int Main (string[] args) { long fsize1; long fsize2; long byteswritten; byte[][] ba; WormRaid wr; Random rand = new Random(); try { fsize1 = 1024L;//only odd multiple of 1024 will not work fsize2 = 512L; Console.WriteLine(" (" + fsize1 + "), (" + fsize2 + ")\n"); // Create the data to send ba = new byte[2][]; ba[0] = new byte[(int)fsize1]; rand.NextBytes(ba[0]); ba[1] = new byte[(int)fsize2]; rand.NextBytes(ba[1]); //Create Stub wr = new WormRaid(); wr.Url = "http://localhost/WSE3Test/WSE3Test.asmx"; //First Test will work always Console.WriteLine("WSE3 MTOM:"); wr.RequireMtom = true; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2)); } else { Console.WriteLine("OK\n"); } //This test will fail Console.WriteLine("WSE3 without MTOM:"); wr.RequireMtom = false; byteswritten = wr.WriteBytes(ba); if (byteswritten != fsize1 + fsize2) { Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));