Exposing classes' methods/properties in Web Service [modified]
-
I have the following problem: i want to be able to fill a class with data in the client side which uses my web service and then send that class to one of its web methods. For this purpose, i used [Serializable] attribute above all my classes in the web service that should be available in the client side for that purpose. The problem is that i can see the classes in the client side, but can't call their methods and properties even though they are public. how can i do that? is there an attribute which should be used above each public method/property of a class which is marked Serializable? Thanks. -- modified at 5:30 Thursday 3rd August, 2006
-
I have the following problem: i want to be able to fill a class with data in the client side which uses my web service and then send that class to one of its web methods. For this purpose, i used [Serializable] attribute above all my classes in the web service that should be available in the client side for that purpose. The problem is that i can see the classes in the client side, but can't call their methods and properties even though they are public. how can i do that? is there an attribute which should be used above each public method/property of a class which is marked Serializable? Thanks. -- modified at 5:30 Thursday 3rd August, 2006
Create an bject for the Class in the web service in your Application For Eg WebApplication1.MyWebservice1.Service1 ObJEct = new WebApplication1.MyWebservice1.Service1(); ObJEct.methdName(); By this you can call the Web methods and propertiesof your Web Services. Hope this Solves your problem. note : You should Add [WebMethod] attribute on top of all the methods in the web service to make the methods visible to your client .. -- modified at 17:27 Thursday 3rd August, 2006
Luck is Opportunity with hardwork
-
Create an bject for the Class in the web service in your Application For Eg WebApplication1.MyWebservice1.Service1 ObJEct = new WebApplication1.MyWebservice1.Service1(); ObJEct.methdName(); By this you can call the Web methods and propertiesof your Web Services. Hope this Solves your problem. note : You should Add [WebMethod] attribute on top of all the methods in the web service to make the methods visible to your client .. -- modified at 17:27 Thursday 3rd August, 2006
Luck is Opportunity with hardwork
This is not the case... The problem is not with the Web service's methods (which are woking just fine). it is with classes that are used to create an object that should be used by the client to fill information. let's say i have the following in the web service's class "Service1": ----- [WebMethod] public string test(MyInfo TestData) ----- Now, "MyInfo" is a class which has other classes as attributes which have properties/methods. In the client side, i want to be able to fill the TestData class with information (and its internal classes) and send it to the method. These are the methods/properties i want to be able to use in the client side. So, to be able to see all the classes that MyInfo holds, i used [XmlInclude] attribute for each of these classes. now - i can create these classes and see them in the client, but all their properties/methods i cannot see even though they are public.