[Xml-compile] XML::Compile::SOAP 2.05 [XOP/MTOM]

Mark Overmeer mark at overmeer.net
Thu May 28 11:33:35 GMT 2009


Hi,

A new version of XML::Compile::SOAP is available.  ChangeLog included
further down.  Main changes:
  . MTOM/XOP support
  . RPC-literal fixes

Please help me with some small SOAP1.2 and WSDL2 examples, so that I
have a test-bed for upcoming developments of these components.

  MarkOv

==== MTOM/XOP support

Luong Truong pointed me to MTOM/XOP... which got implemented yesterday,
just because it is so nasty.

 MTOM = Message Transmission Optimization Mechanism
 XOP  = XML-binary Optimized Packaging

"Optimization" is a big word.  MTOM says that big binary blobs like
images, which can be stored in XML messages in base64 encoding, will
be transmitted in binary.  Base64 is 25% larger than binary.  Wow,
what a gain!  Anyway: the resulting XML message is much smaller.

XOP tells how to achieve MTOM: the simple SOAP is transformed into a
multipart/related message.  Officially, first normal XML is produced
with base64 encoded binary data in it.  Then, the XOP processor extracts
those base64 parts and converts them back into binary to be sent.  After
receipt, the other party's XOP processor converts the binary back into
the base64 on the right spot of the XML message.

Of course, my implementation simply avoids the conversions, avoiding
this:
   picture -> base64enc -> base64dec -> transmit
      -> base64enc -> base64dec -> webpage
for
   picture -> transmit -> webpage

= example: sending with XOP.

In stead of 
   $data = { ...., image => $picture_bytes, ... }
where image is of type base64Binary (this leads to an inlined image)

you now do:
   use XML::Compile::XOP;
   my $xop = XML::Compile::XOP->new;   # only once

   $data = { ...., image => $xop->bytes($picture_bytes), ... }
That's all.

= example: receiving XOP

If the server uses XOP, the only thing you need to do is:
   use XML::Compile::XOP;

This will automatically change the way messages are decoded.  Of course,
that comes with a cost, so therefore the need for you to require the
module explicitly.

As simple as that... hopefully, the real implementations follow the
standards which I have implemented.

==== ChangeLog

  version 2.05: Thu May 28 12:31:46 CEST 2009

    Fixes:

    - remove XML::Compile::SOAP::Tester, because it was not completely
      developed.  Signaled by [Georg Oechsler]

    - use 'namespace' parameter (if available) in SOAP::RPC
      Reported by [Daniel Ruoso]

    - rpc-literal one-way fix (hopefully).  Reported by [Daniel Ruoso]

    Improvements:

    - support MTOM and XOP in new modules XML::Compile::XOP(::Include)
      tests in t/60xop.t   Needed by [Luong Truong]

    - trace which message top-nodes are being skipped.

-- 
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