If I have a WCF service and I’m trying to access a method in that service.
For example:
TestObject test = new TestObject("Test Title");
MyService myNewService = new MyService();
myNewService.SaveObjectToDataBase(test);
Why is it that I get an error saying that the argument list expects a data type MyConsoleApplication.MyService.TestObject rather than TestObject?
It was not doing this before I updated my service reference. I don’t think I changed any relevant properties that would cause this.
Does anyone have any ideas as to why this happens?
EDIT
The SaveObjectToDataBase() expects a parameter of type TestObject only.
When you create a service reference, there is an option to re-use existing classes in the proxy that is generated. If you don’t do this, it creates custom classes for the interface which, while they may match yours by name and properties, are not the same. Try updating the service reference again, and keep an eye out for this option. You get to it by clicking on the Advanced… button – it’s the ticked one here: