ad_proc -soap_p 1 foo::bar {
} and have it exported as a web service.
This is similar to what is done for .NET, I believe.