[Xml-compile] Help with compiling serializers and de-serializers

Mark Overmeer mark at overmeer.net
Mon May 23 07:16:25 GMT 2011


* Bill Moseley (moseley at hank.org) [110523 03:41]:
> Actually, I'm not using that right now.  All I'm trying to do is map a SOAP
> XML request => Perl data, and Perl data => SOAP XML response.
> The WSDL I'm working with defines both a Header and Body and I need to
> decode/encode both, not just the Body.

This is standard behavior of the module.   Should should not be
doing that your self.

You described that you are working on a connection to Catalyst,
so you should probably write your own transport plugin. Copy
XML::Compile::Transport::SOAPHTTP and strip most of it. When your script
loads your XML::Compile::Transport::Catalyst, it should be able to work
like all other XML::Compile clients work (a client is a process which
initiates the action, that could be a daemon)

> 1) XML::Compile should be able compile a single subroutine that in one
> operation will move the SOAP request => Perl, and then Perl back to SOAP
> response and process both the Header and Body?

Yes, that's normal behavior. As far as I understand now, your
complication is that you need a less usual subset of functionality.

Did you have a look at XML::CompileX::Transport::SOAPXMPP or
Calayst::Controller::SOAP by Daniel Ruoso?  Those modules do
not follow my rules of clean interfacing and call convensions
so use a different namespace. But they use XML::Compile logic
internally.

> 2) XML::Compile currently cannot do #1?

Wrong

It seems to me (but I have been wrong before while answering your
questions) that you try to hook the wrong spot. You are trying to
manage on the message level, abusing the internals, where it seems
that you only need a different transport mechanism.

Translating the interneal operation logic into a routine which
does the data structure translation is quite difficult. Most of
the code from XML::Compile::SOAP, XML::Compile::SOAP11 and
XML::Compile::SOAP11::Operation is needed for that task.

> I re-uploaded to  http://hank.org/soap_compile.pl.  My question is with the
> current state of XML::Compile::SOAP is there any other approach that what
> I'm doing in that script?

There is nearly no code in there what other users would write.

> Again, I'm not using that Catalyst controller at this point.  Once I can
> move XML <=> Perl for the request and response adding it to Catalyst will be
> no problem. I just would like to make sure I'm using XML::Compile as it was
> intended.

Implement your transporter object and all will work.
-- 
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