I have to pass several arguments to a WCF service so I created a class with the appropriate fields and thought I'd pass an instance of that class to the service. But the service sees that class as different than the one it has.
So I thought of creating that class in the service, but I found that in the calling program
Class1 c = new Class1 ();//of the class in the service
FieldInfo[] f = c.GetType().GetFields();
Returns nothing.
So I tried making an interface, but the service still wants its class from the service.
So how can I pass a custom class instance and still be able to use that class in the caller like any other class?
EDIT:
This is what I'm doing: I created a website (just the simple template) in VWD (-Visual Studio for web). And added a WCF service and a file with
[DataContract]
[Serializable()]
public class Class1
{
[DataMember]
public string s = "";
}
EDIT: OK. For some reason the fields are converted to properties.
Thank you all!