[offtopic] marshalling

Tyson Dowd trd@cs.mu.OZ.AU
Wed, 3 Jan 2001 18:24:32 +1100


On 03-Jan-2001, Christopher Browne <cbbrowne@smtp.hex.net> wrote:
> On Tue, 02 Jan 2001 14:50:24 CST, the world broke into rejoicing as
> linas@linas.org  said:
> > This is way off-topic, but ...
> > 
> > It's been rumoured that Tyson Dowd said:
> > >
> > > (Actually M$ has a lot more in the whole language infrastructure thing,
> > > since their VM supports multiple language interoperation at the data
> > > level on the same machine -- no marshalling required.  
> > 
> > Well, that's kind-of what we do with g-wrap, and its kind-of what's
> > behind one of the original early claims of gnome's ORBit: that with
> > orbit, a call on the same machine would be roughly as fast as an
> > ordinary subroutine call. (I don't know if they kept that promise).
> > 
> > Here's the question: if one writes a soap dtd/schema in the M$
> > framework, it will then auto-generate language bindings for several 
> > languages? (i.e. they treat the  soap dtd/schema as an IDL for 
> > all practical purposes? OR did they invent some new IDL language?)
> 
> None of the above.

This is quite true.  One of MS's aims was "no more IDL".

> What SOAP amounts to is a way of transmitting around messages in XML
> form.
> 
> Which means that "marshalling" amounts to, on the transmission side,
> generating a string/stream that is an XML document.  And on the
> "receiver" side, "demarshalling" involves parsing an XML document
> and extracting the tags.

Yes.

> See:
> http://www.pythonware.com/products/soap/profile.htm
> for more details.
> 
> The "clever marshalling" thing with ORBit most certainly Does Not
> Apply _in spades_ to SOAP.

Yes -- to SOAP (by definition, wouldn't be using SOAP if you didn't go
to XML).  

However, this hides the intent of .NET, which I think is what Linas is
trying to ask about -- he just asked the question in the wrong direction.

If you write code in a language that targets .NET, you will
automatically get a SOAP/XML binding that can automatically generate a
WSDL (Web Services) description (that is, XML Schema).  But not vice
versa.  The Schema is a way of describing the call site to remote code,
but it is the call site itself that generates the schema.  In an IDL,
the IDL describes the call site to remote code AND generates the call
site, all you get to do is fill in the stuff between the { and }.

All you have to do to make a normal class method into a web method is
add a single "webmethod" attribute to the code (this is pretty
trivial to do).

Since .NET code all runs on the same VM, regardless of the source
language, you automatically get ORBit style "clever marshalling" (that
is, no marshalling at all) for local calls to other .NET code.
Only when you are making remote calls, or calls to some separate local
VM [1] will you go to SOAP.  (Some marshalling does take place when you
do interoperation with COM components).

The VM provides these services in much the same way that it provides
garbage collection or threads.  Everyone who runs in the VM can use
them.

(there will be more on this topic in a reply to your original post).

[1] If there is more than one VM on the machine, which may or may not
    possible. 

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd@cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #