Mono WebServices - Part 2

Posted on Sunday, November 14, 2004 in Uncategorized

On a roll here…

I’ve converted my Mono -> MySQL demo page to exist as web service as well. Essentially the same background code, just with a bit of abstraction and the ASP.NET web service syntactic sugar.

So, now you can read a list of blog entry titles into your own application! Well, as long as your language-of-choice supports DataSets that is.

To re-hash some of the instructions in my previous post:

Generate a proxy client with:

  $ wsdl -n:Schwuk http://schwuk.com/wip/titlelist.asmx?wsdl

Save the following as TitleListClient.cs:

 using System;
 using System.Data;
 using Schwuk;

 class MainClass
 {
   public static void Main(string[] args)
   {
     TitleList ws = new TitleList();

     DataSet ds = ws.GetTitles();

     foreach (DataRow row in ds.Tables[0 ].Rows)
     {
       Console.WriteLine(row[1 ]);
     }
   }
 }

I’ve had to include some extra spaces in that code to make Textpattern play nicely…

Compile with:

 mcs -r:System.Data -r:System.Web.Services TitleListClient.cs TitleList.cs

That’s it. No MonoDevelop project this time, but you can get a pre-compiled executable if you’re feeling lazy…

Related posts:

Mono WebServices Whilst converting fellow CLUG’er Mark to Mono (on Windows no... Powered by Mono? OK, it’s not true yet, but it will be…... Mono from Source I’ve been planning to do this for a while, but... Mono on Ubuntu Spent a little while figuring out the correct incantation to... New Mono Mono 1.0.2 has been released1. Descriptions of the changes are...

Related posts brought to you by Yet Another Related Posts Plugin.


Mobilized by Mowser Mowser
Mobilytics