Hi,
I need to create a webservice, and write two methods to save data into database.
i have two tables in my database (Vacations and Vacation_Details) , the first method to insert data to Vacation table and must return an integer.
the second method that can insert multiple rows into vacation details based on the first method, so it must accept array of objects.
i need help how to create the web service and its methods, and how to test it.
many thanks.
Pradeep ShetPosted Dec 21, 2014, 5:00 AM
Only thing you need to understand about webservice is
1) Any method you create within a class and want to expose that method to public then decorate the method with WebMethod attribute and method should be public.
2) If you want WebMethod client for calling then that file should be with extension of .asmx which will contain referencing .net class name.
3) To test the webservice call the .asmx file from url and you will get your webmethod list over there. Call it pass your parameters and get the output as SOAP(xml)
4) IF you want to use this webmethod in your project then you can add reference of that webservice file which will create a proxy & WSDL for you using which you can invoke the webservice hosted in any server via your application
For more reference
http://www.codeproject.com/Articles/1231/ASP-NET-Web-Service
I hope this answers your doubt. If yes plz mark it as answered