View Single Post
Old 10-20-2006   #1 (permalink)
Steve B.


 
 

WCF RC1: having problem with the DataContract attribute

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()

{

}

}


My System SpecsSystem Spec