Click here to Skip to main content
15,900,512 members
Home / Discussions / C#
   

C#

 
GeneralDataGridView Pin
bdiepeveen30-Mar-08 22:15
bdiepeveen30-Mar-08 22:15 
GeneralRe: DataGridView Pin
Laddie30-Mar-08 23:42
Laddie30-Mar-08 23:42 
GeneralRe: DataGridView Pin
bdiepeveen31-Mar-08 0:30
bdiepeveen31-Mar-08 0:30 
QuestionDifference Between C# and C#.Net Pin
Krazy Programmer30-Mar-08 21:58
Krazy Programmer30-Mar-08 21:58 
GeneralRe: Difference Between C# and C#.Net Pin
MarkB77730-Mar-08 22:40
MarkB77730-Mar-08 22:40 
AnswerRe: Difference Between C# and C#.Net Pin
Abhijit Jana30-Mar-08 22:41
professionalAbhijit Jana30-Mar-08 22:41 
GeneralRe: Difference Between C# and C#.Net Pin
Guffa30-Mar-08 23:03
Guffa30-Mar-08 23:03 
GeneralLoosing Bytes in byte[][] while using WSE3 without MTOM Pin
DanielWehrle30-Mar-08 21:50
DanielWehrle30-Mar-08 21:50 
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));
}
else
{
Console.WriteLine("OK\n");
}

}
catch (Exception exc)
{
}
}

Sample output:
-------------------------------------------------
Y:\>Client.exe
(1024), (512)

WSE3 MTOM:
OK

WSE3 without MTOM:
!!! ERROR LENGTH !!!
Written: 1024, expected: 1536
-------------------------------------------------

Get anyone the same results?
Is there any known solution for this Problem?


Thank you,
-- Daniel Wehrle
QuestionStretching images in an image box Pin
Muammar©30-Mar-08 21:14
Muammar©30-Mar-08 21:14 
GeneralRe: Stretching images in an image box Pin
Guffa30-Mar-08 22:04
Guffa30-Mar-08 22:04 
GeneralRe: Stretching images in an image box Pin
Muammar©30-Mar-08 22:32
Muammar©30-Mar-08 22:32 
GeneralRe: Stretching images in an image box Pin
Guffa31-Mar-08 0:38
Guffa31-Mar-08 0:38 
GeneralRe: Stretching images in an image box Pin
Pete O'Hanlon31-Mar-08 2:19
mvePete O'Hanlon31-Mar-08 2:19 
GeneralRe: Stretching images in an image box Pin
Muammar©31-Mar-08 20:31
Muammar©31-Mar-08 20:31 
GeneralAdd Footer To DataGrid Or DataGridView Pin
Thaer Hamael30-Mar-08 20:53
Thaer Hamael30-Mar-08 20:53 
QuestionHow to set the font of the ToolTipText , such as ToolStripItem.ToolTipText (winform) Pin
wyc_xiaoben30-Mar-08 20:38
wyc_xiaoben30-Mar-08 20:38 
GeneralRe: How to set the font of the ToolTipText , such as ToolStripItem.ToolTipText (winform) Pin
MidwestLimey31-Mar-08 12:50
professionalMidwestLimey31-Mar-08 12:50 
GeneralRe: How to set the font of the ToolTipText , such as ToolStripItem.ToolTipText (winform) Pin
wyc_xiaoben31-Mar-08 16:57
wyc_xiaoben31-Mar-08 16:57 
GeneralRe: How to set the font of the ToolTipText , such as ToolStripItem.ToolTipText (winform) Pin
MidwestLimey1-Apr-08 5:36
professionalMidwestLimey1-Apr-08 5:36 
GeneralRe: How to set the font of the ToolTipText , such as ToolStripItem.ToolTipText (winform) Pin
wyc_xiaoben2-Apr-08 22:21
wyc_xiaoben2-Apr-08 22:21 
QuestionBackend application posting data to web server.. Pin
ptr2void30-Mar-08 20:23
ptr2void30-Mar-08 20:23 
GeneralRe: Backend application posting data to web server.. Pin
Vimalsoft(Pty) Ltd31-Mar-08 1:08
professionalVimalsoft(Pty) Ltd31-Mar-08 1:08 
GeneralArray of bool as dictoinary value Pin
Mc_Topaz30-Mar-08 20:04
Mc_Topaz30-Mar-08 20:04 
GeneralRe: Array of bool as dictoinary value Pin
Vikram A Punathambekar30-Mar-08 21:38
Vikram A Punathambekar30-Mar-08 21:38 
GeneralRe: Array of bool as dictoinary value Pin
Guffa30-Mar-08 22:18
Guffa30-Mar-08 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.