Background
Converting from using .Net Remoting to WCF. Most of the methods on the WCF server are working fine, but ran into one that isn't working today.
This is the service contract:
[ServiceContract]
public interface IMyService
{
[OperationContract]
generated.Response.ACS_Response Check(generated.Request.ACS_Request request);
}
I snipped out the rest of the methods on that interface, since they are working. Basically, I'm trying to pass in a request object and get back a response object.
The classes for ACS_Response and ACS_Reqeust are generated using XSD.exe against an XSD file. Those classes reside in an Api assembly that is referenced by both the WCF client and WCF host.
Problem
I am able to make the call to the WCF host and the Request object and the host is able to do its work. When the host attempts to return the Response object, that's where I encounter an exception.
I turned on tracing for WCF and see an SerializationException saying:
Type 'Api.generated.Response.ACS_ResponseQuestion'
with data contract name 'ACS_ResponseQuestion:http://...' is
not expected. Add any types not known statically.........
Questions
First, I'm confused because I am able to successfully send a Request object, so it would seem the basics are working.
Second, this serialization was working under .Net Remoting. The classes are all generated by WSDL so shouldn't they be serializable as is?
Third, the host and client both reference the same Api assembly which defines these classes, so they are known to both server and client.