Hi guys, I'm trying to build out a WCF service but I've run into a blocking issue. I've been Googling around but I haven't been able to make any progress. Hopefully I'll have more luck here.
Let's say I have a job class defined as such:
[DataContract]
public class Job : IJob
{
public Job(...)
{
}
[DataMember]
public string Example
{
get { return m_example; }
set { m_example = value; }
}
}
Now, what I do is something like this
public void DoSomething()
{
ExampleServiceProxy.ExampleClient proxy = new ExampleServiceProxy.ExampleClient();
proxy.DoSomething(job);
}
Inside of my Reference.cs I've added some ServiceKnownTypeAttribute as follows:
...
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(Job))]
void DoSomething(object job);
My service code is as follows:
[ServiceContract]
public interface IExample
{
[OperationContract]
void DoSomething(IJob);
}
public class Example : IExample
{
public void DoSomething(IJob job)
{
...
}
}
Do I need to put further ServiceKnownTypeAttributes somewhere? Do I need to reimplement the object on the service side?