[Xml-compile] Using xsi:type with XML::Compile
Mark Overmeer
mark at overmeer.net
Tue Aug 28 08:59:50 GMT 2012
* DEIGNAN Ciaran (c.deignan at rsd.com) [120828 07:38]:
> I have a web service that uses "xsi:type" in a reply. I've succeeded
> using the syntax documented here:
Oi. Bad news. Makes things a bit more complicated.
Some designers have not discovered substitionGroups yet :(
> http://search.cpan.org/~markov/XML-Compile-1.26/lib/XML/Compile/Schema.pod
> However the AUTO mode doesn't seem to work.
Which version of XML::Compile do you have? It only got added in 1.25
The logic is in XML::Compile::Schema::NameSpaces::autoexpand_xsi_type($)
Also t/75type.t tests that it works.
> I can get my web service to work with
> my $gfp = $wsdl->compileClient('GetFilePlan', endpoint => $Endpoint . 'nodemgmt', xsi_type => { '{http://www.rsd.com/2011/07/datatype/schema}FilePlanType' => '{http://www.rsd.com/2011/07/datatype/schema}rmFilePlanType' });
Easier:
$wsdl->prefix(dt => 'http://www.rsd.com/2011/07/datatype/schema');
xsi_type => { 'dt:FilePlanType' => 'dt:rmFilePlanType' }
> The "use Log::Report mode => 3;" doesn't appear to give information on
> the xsi_type declaration.
It will show you the list of choices for AUTO.
> I tried the AUTO mode like this
> my $gfp = $wsdl->compileClient('GetFilePlan', endpoint => $Endpoint . 'nodemgmt', xsi_type => { '{http://www.rsd.com/2011/07/datatype/schema}FilePlanType' => 'AUTO' });
Correct. Or
xsi_type => { 'dt:FilePlanType' => 'AUTO' }
--
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