This link has been bookmarked by 1 people . It was first bookmarked on 26 Jul 2006, by Raúl - [^BgTA^].
Como crear un webservice en .NET (a manubrio)
Writing
Writing web services is not difficult, on the contrary it's a very easy task, you only need to derive from the System.Web.Services.WebService class, set some public methods with their respective
You need to acces the web service from within your Gtk# application, for doing that task you need to get the proxy from that web service, use this:
wsdl http://localhost:8081/index.asmx?wsdl -out:WSAppProxy.cs -n:GtkWebService
for creating the proxy class that allows you to access the public methods from the webservice.
Writing web services is not difficult, on the contrary it's a very easy task, you only need to derive from the System.Web.Services.WebService class, set some public methods with their respective attributes and ready. Lets starting writing our web service:
#File: RemoteWebService.cs //mcs -r:System,System.Web,System.Web.Services RemoteWebService.cs -t:library using System; using System.Web; using System.Web.Services; namespace GtkWebservice { [WebService (Description="Our first web service")] public class RemoteWebService : System.Web.Services.WebService { [WebMethod (Description="Adds two numbers")] public int Add (int firstNumber, int secondNumber) { return firstNumber + secondNumber; } } }
We need to set the [WebService ()] attribute in the class for setting that class as the web service class, and we need to set the [WebMethod ()] attribute for setting that method as one web service's method, remember to set as public your web service methods, of course if you want to access then by the "outside world".
Page Comments
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.