Reputation: 44312
In my WCF project, I have a type that comes from a different library:
LibraryB.SomeClass
In the svc.cs file for the service, I use the above type in a parameter:
GetEmployees(LibraryB.SomeClass someClass)
In the web app that is hosting the service, a type is created for the service:
MyWebApp.ServiceAReference.ServiceAClient serviceClient = new MyWebApp.ServiceAReference.ServiceAClient();
But when I reference the method:
serviceClient.GetEmployees(someClass);
The intellisense for the parameter is of type:
MyWebApp.ServiceA.SomeClass
In the web app, someClass is of type LibraryB.SomeClass and not MyWebApp.ServiceA.SomeClass.
Is there some way to tell the web service to send the type LibraryB.SomeClass across the wire? Or is there something different I should be doing?
Upvotes: 2
Views: 88
Reputation: 24078
The client does not always have access to the server's types. The server might not even be your code! For that reason proxy objects are created on the client side to represent the server's objects.
If the server and client side share the asemblies that contain the type that is sent over the wire, you can tell your application to re-use it when you add your service reference.
Upvotes: 4