Introducing web services, with JavaScript using Internet Explorer's WebService component. II, III, IV, V, VI, VII, VIII, IX, X, XI. Hmm, IE-only WS component...
Ah, here we go: Mozilla SOAP API. Let there be a public domain cross-browser wrapper library!
See also this weird but nice article on SOAP, AppleScript and Perl: AppleScript for the client, Perl for the service, on the same machine, which, apparently, you'd want to do as a way to pass structured data between AppleScript and Perl. There are probably other uses, too!