Hi Steve,
What languages are you using? I've used web services in ASP.Net (C#) quite a bit recently but I've no idea how you'd do it in say, Java or Python.
Certainly within .Net it's easy peasy, as there are big libraries that wrap up most of the really difficult stuff, so you just have to worry about what you want the web service to do.
To create a web service (for other people to consume) in .Net is pretty much like any other web page. You just add a using reference and mark the relevant public methods as [WebMethod]
The Code behind (HelloWorld.asmx.cs)would look something like:
Code:
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
namespace ProductReviews.WebService
{
/// <summary>
/// Summary description for HelloWorld
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class HelloWorld : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
Then just dump that on an IIS or Mod_Mono server and Robert's your father's brother.
To consume the Web Service is in some ways even easier, but in others a bit confusing. Visual Studio (The .net dev environment) tries to be a bit too clever, so I use a command line tool to generate some c# proxy classes, that you then use like any other class.
Eg on my box, to generate the proxy class I fire up the Visual Studio command promt and type:
Code:
wsdl http://localhost/HelloWorld.asmx?WSDL
this will generate a file called "HelloWorld.cs" that I can include in my consuming project. It will expose some public methods that call the web service for me. Easy Peasy, and there are loads of good guides on Google.
I believe that most modern languages are just as easy, but different.