TheNetStriker

I'am trying to send a DataContract from a wcf client to a server, but when the the object arrives, all the values are set to nothing, but I filled up the values before I sent the object to the server. I have the same problem when I send back a DataContract to the client.

What can cause such a problem I tried it with a simple DataContract and it didn't work also. But a simple function, which retrurns a strings is working. Here is the code of my test DataContract:

<DataContract()> _
Public Class Test
Implements IExtensibleDataObject

Private extensionDataObjectValue As ExtensionDataObject

Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return extensionDataObjectValue
End Get
Set(ByVal value As System.Runtime.Serialization.ExtensionDataObject)
extensionDataObjectValue = value
End Set
End Property

Private strTest As String

<DataMember()> _
Public Property Test() As String
Get
Return strTest
End Get
Set(ByVal value As String)
strTest = value
End Set
End Property
End Class


Re: Windows Communication Foundation (Indigo) DataContract always with nothing values


Re: Windows Communication Foundation (Indigo) DataContract always with nothing values

TheNetStriker

I don't have such booleans as described in this article on the client side and when I set this IsRequired attribute to true, then the sub on the server side isnt't called anymore. Without the attribute it gets called, but with the nothing values in the object.




Re: Windows Communication Foundation (Indigo) DataContract always with nothing values

Carlos Figueira - MSFT

Do you have the RootNamespace set in the VB project (project properties, Application tab) on either client or server If so, can you remove it (from both client and server) to see if this will help

If this solves the problem, the explanation for this is in the thread http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1037329&SiteID=1.





Re: Windows Communication Foundation (Indigo) DataContract always with nothing values

TheNetStriker

Yes I had RootNamespaces in my project. I removed them and then it worked perfetcly. Thanks for your help.