domingo, 16 de mayo de 2010

A Simple Web Service Example with Mono

Mi code is this:

GenericWebService.cs

using System;
using System.Web.Services;

namespace GenericWebService
{
[WebService (Description="Our first web service")]
public class GenericWebService : WebService
{
[WebMethod]
public string SayHi()
{
return "Hiii";
}
}
}


Another file GenericWebService.asmx

<%@ WebService Class="GenericWebService.GenericWebService" %>


Compile with:

mcs -r:System,System.Web,System.Web.Services GenericWebService.cs -t:library

Then create a bin directory, put your dll into bin directory and execute over shell:

$ xsp

Open your firefox browser ... is there another browser? Ok

http://localhost:8080/GenericWebService.asmx

See the result :D

No hay comentarios:

Publicar un comentario