[Xml-compile] Schema interpretation

Kaare Rasmussen kaare at jasonic.dk
Mon Sep 8 09:56:31 BST 2008


Hi 

I'm a bit stuck with this construct. This is from a .NET schema, and I'm 
trying to access the web service as a client. 

<xs:element name="GetDetails">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Identifiers" nillable="true" 
type="q3:ArrayOfstring" 
xmlns:q3="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
</xs:sequence>
</xs:complexType>
</xs:element> 

I would naively think that the call should look like this 

($answer, $trace) = $GetDetails->(Identifiers => [qw/id1 id2/] ); 

But this responds with an error:
ARRAY(0x1de0400) is no HASH at 
/usr/local/share/perl/5.8.8/XML/Compile/Translate/Writer.pm line 460.
error: complex `x0:Identifiers' requires a HASH of input data, not `ARRAY' 
at {...namespace...}GetDetails/Identifiers 

This call actually works: 

($answer, $trace) = $GetDetails->(Identifiers => {string => 'id1'} ); 

And it responds with details for id1. But is not very useful if I want more 
ids. 

So my question is, what interpretation is right? .NET or XML::Compile?



More information about the Xml-compile mailing list