Reputation:
I'm trying to return a class Foo, which is located in solution A
public class Foo {
// some data
}
from a webservice in solution B
[WebMethod]
public Foo Test() {
return new Foo();
}
which is called from solution C.
The problem is that the type of the web method returns type B.Foo instead of Foo, which cannot be converted to type Foo.
Probably it is possible to serialize the object, and then deserialize it but it is kinda messy. Is there a way to just do it objectwise?
Upvotes: 2
Views: 115
Reputation: 1371
Is it possible for you to use WCF instead of the ancient .asmx web services? Because DataContracts will do exactly what you want.
Upvotes: 2