I found the reason of this error ... The array of byte exceeds 16K, and it
is more than what the default behaviour allow.
What are the possible solutions ? The byte array was used to embed files...
Is there any other better way to transfert file ? (which should be quite
large (up to 100 Mo)...
Steve
"Steve B." <steve_beauge@com.msn_swap_msn_and_com> a écrit dans le message
de news:
OUYqIyC9GHA.1172@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I'm building a small application that can send data between servers.
>
> The Data object is a simple class with 3 properties (2 strings, and a
> byte[] array).
>
> If I add [DataMember] over each properties, the call to the remote server
> throw an error : 400 Bad Request (I'm using the wsHttpBinding).
>
> If I remove the [DataMember] attribute, the remote method is reached, but
> each properties of my object is "null" (normal since the datamember
> attribute is not set).
>
> As I said in a previous post, the server sometimes acts as client,
> sometimes act as server. Then I don't use a proxy created by VS, but a
> ChannelFactory.
>
> What is wrong ?
>
> Thanks in advance for any help...
> Steve
>
> [DataContract]
>
> public class MyDataClass
>
> {
>
> private byte[] m_bytes;
>
>
> [DataMember]
>
> public byte[] Bytes
>
> {
>
> get { return m_bytes; }
>
> set { m_bytes= value; }
>
> }
>
> private string m_string2;
>
> [DataMember]
>
> public string String2
>
> {
>
> get { return m_string2; }
>
> set { m_string2= value; }
>
> }
>
> private string m_string1;
>
> [DataMember]
>
> public string String1
>
> {
>
> get { return m_string1; }
>
> set { m_string1= value; }
>
> }
>
>
>
> public MyDataClass(
>
> string string1,
>
> string string1,
>
> byte[] raw
>
> )
>
> {
>
> this.m_string1= string1;
>
> this.m_string1= string1;
>
> this.m_raw= raw;
>
> }
>
> public MyDataClass()
>
> {
>
> }
>
> }
>
>