[Xml-compile] getting started with XML-Compile

Mark Overmeer mark at overmeer.net
Sun Aug 22 19:31:18 GMT 2010


* Ted Pedersen (duluthted at gmail.com) [100822 16:35]:
> My goal is to allow remote users to call the methods that are
> available in the module in more or less the same way they would use
> them if they had the module locally installed.

Typical Client-Server wish.

> Is this something that would be reasonable to do with XML::Compile,
> and if so, are there any examples of how to take an existing module
> and "convert it" into something that will run as I'm describing?

For client-server applications, you need at leaset the following:

  server functionality     (your current code)
  server protocol-adapter
         messages
  client protocol-adapter
  client code

First you need to design your messages. There are many ways to transport
data between two applications: serialization, sun-rpc, XML-RPC, HTTP,
XMPP, million other methods, and SOAP.

SOAP is a horrible protocol. XML is sub-optimal, to say the least. But
both are widely accepted in the professional world. At least, it makes
it very simple to create clients in various languages, for instance Java:
they all understand SOAP and WSDL.

So what you need to do is to design messages. Produce an XML-schema
(not simple!) which defines what you want to sent and receive. There are
various tools which help you a little. Designing smart messages is even
more difficult than learning XML-schema. From the Schema, with about
100 extra lines, you construct a WSDL which the clients need.

Then, you need to create a server daemon which contains your functionality
(probably unchanged) and have it being called from the protocol adapter.
See XML::Compile::SOAP::HTTPDaemon... there are scripts in the example
directory which will show you how simple that is (just a few minutes
of work)

If you need a Perl based client, you may use XML::Compile::SOAP. Very
simple as well (see same examples)

The Messages/Schemas/WSDL step can easily take you months. Certainly
if this is the first time you do it. The rest is peanuts.

You may also look at REST,
   http://en.wikipedia.org/wiki/Representational_State_Transfer
depends on your application.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list