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

Bill Moseley moseley at hank.org
Mon May 23 15:53:35 GMT 2011


On Mon, May 23, 2011 at 12:16 AM, Mark Overmeer <mark at overmeer.net> wrote:

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


I've looked at XML::Compile::Transport::SOAPHTTP and from what I see just
builds the HTTP::Request and sends it.  That's easy to override with a
transport_hook.  Perhaps I'm missing what you are implying I should do,
though.

Again, I'm trying to write a server -- so I'll receive an XML request (and
hopefully) use XML::Compile to decode that into Perl data, and then send my
response back as Perl data and have XML::Compile turn that back into XML
response (or HTTP::Request) as defined by the WSDL.

So, using $wsdl->call() is kind of the reverse of what I need as that does
Perl -> XML -> HTTP -> response XML -> Perl.

Note that my original problem is that it seems as if <Header> is not
generated even though it seems defined in the WSDL (and indeed
$operation->{input_def} shows it.

If you look at (or run) http://hank.org/soaphttp.pl you will see that no
<Header> element is generated in the request:

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body=
><tns:createPersonRequest
xmlns:tns=3D"
http://www.imsglobal.org/services/lis/pms2p0/wsdl11/sync/imspms_v2p0
"><tns:sourcedId>1306165209</tns:sourcedId><tns:personRecord><tns:sourcedGU=
ID><tns:sourcedId>1306165209</tns:sourcedId></tns:sourcedGUID></tns:personR=
ecord></tns:createPersonRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

that's created with this:

my $wsdl =3D XML::Compile::WSDL11->new( $wsdl_data );

$wsdl->compileCalls( transport_hook =3D> sub { die shift->as_string } );

$wsdl->call( 'createPerson',
    {
        #imsx_version =3D> 1.0,  # complains
        sourcedId    =3D> time,
        personRecord =3D> {
            sourcedGUID =3D> {
                sourcedId =3D> time,
            },
        },
    },
);


If I'm really doing that incorrectly can you show what code changes are
needed to that example above to see the <Header> in the request?


Thanks,

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20110523/d2=
114e6b/attachment-0001.htm


More information about the Xml-compile mailing list