|
-
June 15th, 2009, 08:26 AM
#4
Re: WCF exception
Following is a codesnippet from my own project, which works fine only using DataContract and DataMember attributes.
Code:
[DataContract]
public class User {
[DataMember]
public int ID {
...
}
[DataMember]
public string Username {
...
}
[DataMember]
public UserRole UserRole {
...
}
}
[DataContract]
public class UserRole {
[DataMember]
public int ID {
...
}
[DataMember]
public string Description {
...
}
}
As you can see, it has the same syntax as your example. I don't use Surrogates or (Service)KnownType, and it works just fine.
The reason of the CommunicationException seems that WCF cannot serialize the class B and class C objects in class A
Can you please quote the CommuncationException (message and innerexception), instead of saying only what is causing it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|