Last post Aug 09, 2013 04:01 PM by kushalrdalal
Aug 09, 2013 10:01 AM|tombean|LINK
I have a web service developed in C# that uses a class library containing strongly typed datasets. When a client application has references to the web service and the dataset class library, all the properties and methods of the dataset class library are
exposed by the web service as well as through the reference to the dataset class library.
This causes "an ambiguous reference" error between the web service and the dataset class library.
Does a web service expose all of the properties and methods of all assemblies it references? And, it there any way to prevent this?
Aug 09, 2013 04:01 PM|kushalrdalal|LINK
Are you using asmx service or wcf service?
For asmx service which methods you want to expose you have to add [WebMethod] attribute.
For wcf service you can add methods you want to expose [OperationContract] and define in interface [OperationContract] and then implement in the class that implement the interface.
If you will not put [webmethod] or [operationcontract] attribute then that method won't expose.