[MOBY] Re: [MOBY-dev] surprising results with speed tests:

Mark Wilkinson markw at illuminae.com
Wed Jul 30 00:19:41 UTC 2003


We had precisely this discussion at the last MOBY meeting.  We decided
that MOBY (both Services and Central) should expect the payload to
arrive either as base64 encoded XML, or as "bare" XML (i.e. CDATA
because the messages contain a <?...> processing tag which will break
XML parsers if it is in the middle of a message)

Martin - in what way is CGI not language-neutral, and therefore
preferable to SOAP?  As I have coded it (I wont commit it until I have
run all tests) you send a GET request with the following form:

http://servername.com/mobycentral.cgi?action=findService;payload=__URL
encoded XML__

What is returned to you is:

Content-type: text/plain

<?xml .....>
<MOBY>
	<response info here>...</response>
</MOBY>

i.e. exactly what happens now, except that there is no SOAP procedure
call.  I don't see how this is any less language-nautral than the
current situation...

In any case, I have coded the Perl client (MOBY Central required no
recoding at all) such that it can talk to both CGI and SOAP MOBY
Centrals, and I will certainly leave both of them running indefinitely,
so we won't be losing anything... we just gain a new way to execute the
queries.  I'll make a similar option available for service providers,
where the registered "type" tag will be "moby-get" as opposed to the
current "moby" to distinguish it from SOAP-based services.

I think this is a good thing, not a detriment :-)

M




On Tue, 2003-07-29 at 15:37, Martin Senger wrote:
> > Can you elaborate a little...does that mean to take the whole block of XML
> > specifying the service's inputs and encode it?
> >
>    Yes. All the Moby Central methods have parameters that are XML
> fragments. These fragments can be treated either as simple strings (as
> they are now) - which means that they are represented as "XML in XML"
> (they are encoded into XML-based SOAP message).
>  
> > How does it save time?
> > 
>    I do not know if it saves time, it depends on the usual size of the
> parameters. If you send them as strings, there is a known problem with the
> expat module (quoting below). If you send them as base64 encoded
> characters you double their size. So some tests would be needed to make a
> decision.
> 
>    This is what SOAP:;Lite docs says about it:
> 
>            SOAP::Lite is based on XML::Parser which is basically
>            wrapper around James Clark's expat parser. Expat's
>            behavior for parsing XML encoded string can affect
>            processing messages that have lot of encoded entities,
>            like XML fragments, encoded as strings. Providing low-
>            level details, parser will call char() callback for
>            every portion of processed stream, but individually
>            for every processed entity or newline. It can lead to
>            lot of calls and additional memory manager expenses
>            even for small messages. By contrast, XML messages
>            which are encoded as base64, don't have this problem
>            and difference in processing time can be significant.
>            For XML encoded string that has about 20 lines and 30
>            tags, number of call could be about 100 instead of one
>            for the same string encoded as base64.
> 
>    Martin
-- 
Mark Wilkinson <markw at illuminae.com>
Illuminae




More information about the MOBY-dev mailing list