![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| Guest | 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 Specs![]() |
| | #2 (permalink) |
| Guest | Re: WCF RC1: having problem with the DataContract attribute 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() > > { > > } > > } > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: WCF RC1: having problem with the DataContract attribute IMHO you need stream for that.Check http://windowssdk.msdn.microsoft.com...20(VS.80).aspx Arkady "Steve B." <steve_beauge@com.msn_swap_msn_and_com> wrote in message news:uW0KCpE9GHA.4644@TK2MSFTNGP04.phx.gbl... >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() >> >> { >> >> } >> >> } >> >> > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: WCF RC1: having problem with the DataContract attribute Thus wrote Arkady, > IMHO you need stream for that.Check > http://windowssdk.msdn.microsoft.com...520(VS.80).asp > x Arkady Not only in your opinion ;-) Streams are the *only* way to handle such a payload, as messages are fully buffered in memory. Cheers, -- Joerg Jooss news-reply@joergjooss.de |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| ConfigurationManager with file attribute problem | .NET General | |||
| Temp Folder Attribute Problem | Vista file management | |||
| How to insert the "modified time" attribute in "date taken" attribute in batch mode-in vista or theough a software? | Vista file management | |||