Class Libraries and Web References
-
Hello, I have two C# Applications one client side, one server side, which communicate via a web service that I am creating also. I wanted to create a class library so that classes that are used between the three applications can be re-used. I want to allow one of the webmethods in the web service to accept an object of one of the classes I have created in the class library but when I try and pass it from either application it says I can't because the types are different. ABSWebService.Market doesn't equal ABSClassLibrary.Market (Event though in the web service it is referencing the Class Library to get the Market). I have tried to cast it to the other type, but this isn't allowed either. Any suggestions?
-
Hello, I have two C# Applications one client side, one server side, which communicate via a web service that I am creating also. I wanted to create a class library so that classes that are used between the three applications can be re-used. I want to allow one of the webmethods in the web service to accept an object of one of the classes I have created in the class library but when I try and pass it from either application it says I can't because the types are different. ABSWebService.Market doesn't equal ABSClassLibrary.Market (Event though in the web service it is referencing the Class Library to get the Market). I have tried to cast it to the other type, but this isn't allowed either. Any suggestions?
-
If you are using a WCF Service, when you add the service reference there is a setting for "Re-use classes in referenced assemblies". If you're using old-fashioned web methods I think you're S.O.L.
Well I have only just started creating this, so I was using Web Services as that is what I know. But if it will work with WCF I will try that instead. Just to add to the complexity the class library needs to be able to access another external web service that isn't mine, and all the applications need to create and pass objects of this web service type. Should I just forget Class Libraries?