Web Services, part 2

Matts on 2001-07-16T14:06:23

(please read part 1 first)

So where am I going with all of this?

Microsoft makes tools people apparently like to use. It's very strange, but people love this stuff. I got out of the Windows world about 3.5 years ago now, moving almost exclusively to Linux or other Unixen. I don't look back. I hate Windows. But other people don't. I can partly see where they are coming from. Some of the tools do genuinely make things easier. Like editors. I'm still looking for an editor I'm comfortable with under Linux. Something like Textpad. I don't mind paying $30 for it, but I do object to paying $300 for it (for which I'm sure I could find the editor I want). I like Nedit, but I really want something that's MDI, and with a sidebar that can show the files in the current directory. I'm pretty happy with jedit, but it's Java, so it's pretty unbearably slow on my PII500.

Anyway, where was I :-)

.NET makes creating web services easy. I don't care about C# or the new run time API, or anything like that. My current task is to take an application and turn it into a web service. Shouldn't be hard, right? Well it's not, actually. SOAP::Lite makes things really easy. However, I really quite like the C# syntax of just tagging methods with some attributes and it's automatically a web service.

It was then I thought about the stuff Damian and Marcel have been working on. Attribute::Handlers stuff. Wouldn't it be great if we could do:

sub foo : WebService { }

And have foo automatically become a web service?

Yeah, I thought so too :-)

So I've written Attribute::WebService. I'll stick it on CPAN this week, though it's pretty raw right now. It also hacks into the internals of SOAP::Lite, because the public API wasn't complete enough. It also by default implements it's own httpd using HTTP::Daemon, which is probably a pretty inefficient way to do things. However I *think* I've made it overridable so that you could implement Attribute::WebService::Apache and have it work via mod_perl.

The next step of this project is to be able to export an entire COM object in Win32 via SOAP. I think this can be done using the new Typelib stuff Jan Dubois has put into Win32::OLE::Const. Kudos to Jan for Win32::OLE. I hate windows, but at least thanks to this module I can actually get my job done in Perl.

Anyway, I have to go finish up Attribute::WebService now. Have fun.