This post originated from an RSS feed registered with Java Buzz
by Weiqi Gao.
Original Post: I Wrote a Web Service :)
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
I have never wrote a Web ServiceTM. Until today, that is.
I've heard all about Axis, WSDL, SOAP, doc/literal, rpc/encoded, JAX-RPC, SAAJ, etc. But the process of setting everything up and actually writing and testing a Web Service in Java just seemed so daunting. And I never got around to try it.
The Beta 1 release of Mono contains a ASP.NET/Web Services host called XSP. So I decided to take it for a spin.
[weiqi@gao] $ cat hello.asmx
using System;
using System.Web.Services;
public class Hello : WebService {
[WebMethod()]
public string SayHello() {
return "Hello, World!";
}
}
[weiqi@gao] $ mono /usr/bin/xsp.exe
Listening on port: 8080
Listening on address: 0.0.0.0
Root directory: /home/weiqi/temp/src/webservice
Hit Return to stop the server
The URL http://localhost:8080/hello.asmx gives me the WSDL and client proxy code. I took the client code, added a Main() method, compiled, and run it. It worked as expected.