[m-dev.] web services success

Tyson Dowd trd at cs.mu.OZ.AU
Fri May 18 23:26:43 AEST 2001


I should also mention that today I experimented with creating proxies
for the Mercury web method.  First I extracted the WSDL (Web Services
Description Language) description  of the web service (a tool called
"disco" does this very simply).  Then I ran "wsdl" on the WSDL and it
generated a C# program that was a proxy.

The proxy C# class just calls the Mercury web method using SOAP. 
It is the same as a stub in CORBA (and WSDL plays the role of IDL).
The .NET class has a method that looks just like the original Mercury
web method (only much slower!).

Using this, it's quite easy to call the Mercury web method from C#,
over a network using SOAP and HTTP.

And by using the interface generator that Peter Ross and myself have
been working on you can then generate a Mercury interface to talk to the
proxy (although its under pretty heavy development so it might not work 
very well at the moment -- I haven't tested it but I can't see any
reason why it won't work with the stable version of the interface
generator).

On 18-May-2001, Tyson Richard DOWD <trd at cs.mu.OZ.AU> wrote:
> 
> I've just added support for custom attributes for the .NET backend,
> which means that the code below can be run over SOAP.  I've tested
> this using ASP.NET and it actually works.
> 
> The remaining problems (which were fixed by hand):
> 	- assembly reference is not quite generated correctly.
> 	- for some reason web-methods can only be instance methods
> 	- we need to create a .ctor (constructor) for the class if it
> 	  has instance methods.
> 
> Diffs coming to a mailing list near you tomorrow.
> 
> 
> :- module web_service.
> :- interface.
> 
> :- func foo(string) = string is det.
> 
> :- implementation.
> 
> :- import_module string.
> 
> :- pragma foreign_type(web_method_attribute, 
> 	'System__Web__Services__WebMethodAttribute',
> 	"System.Web.Services").
> :- pragma attribute(foo/1, web_method_attribute).
> 
> foo(X) = "hello " ++ X.
> 
> 
> -- 
>        Tyson Dowd           # 
>                             #  Surreal humour isn't everyone's cup of fur.
>      trd at cs.mu.oz.au        # 
> http://www.cs.mu.oz.au/~trd #
> --------------------------------------------------------------------------
> mercury-developers mailing list
> Post messages to:       mercury-developers at cs.mu.oz.au
> Administrative Queries: owner-mercury-developers at cs.mu.oz.au
> Subscriptions:          mercury-developers-request at cs.mu.oz.au
> --------------------------------------------------------------------------

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list