Question:
I am investigating the possibility of writing a Web Service for a Linux server using C #. This requires the use of Mono-Framework. As I understand it, WCF in Mono is implemented only relatively and I got the feeling that it is better not to touch it. It seems that all the basic things should work, but something is not right …
And I just thought that it might be better to use other frameworks that are adapted for Mono. I found several, but only 3 seemed to me the most interesting:
- Nancy
- ServiceStack
- NServiceBus (it's not clear whether it works in mono at all or not, but it seems like it should.
Does anyone have any experience with similar development and what could be advised for this? Share your experience.
Or is it better to abandon such a project altogether? The client wants the server to run on Linux and Windows without installing Tomcat (so Java is out of the question).
Answer:
try ASP .NET, there are asmx files in there
http://www.mono-project.com/archived/writing_a_webservice/
<%@ WebService Language="C#" Class="MathService.MathService" %>
using System;
using System.Web.Services;
namespace MathService
{
[WebService (Namespace = "http://tempuri.org/NumberService")]
public class MathService : WebService
{
[WebMethod]
public int AddNumbers (int number1, int number2)
{
return number1 + number2;
}
[WebMethod]
public int SubtractNumbers (int number1, int number2)
{
return number1 - number2;
}
}
}