[Xml-compile] XML::Compile::WSDL11 strange error state
Brian E. Lozier
brian at massassi.com
Mon Feb 27 15:48:51 GMT 2012
Upon further examination, I'm not sure I'm getting hit with this
xsi:type thing, given that the wsdl doesn't contain xsi:type anywhere.
It looks like the elements are defined using complexType, is that the
same thing?
An element is being defined like this:
<complexType name="OrderResponseItem" abstract="true">
Then a bit later:
<s:complexType name="OrderResponseDetailLow">
<s:complexContent mixed="false">
<s:extension base="s1:OrderResponseItem">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="OrderStatus" type="s1:OrderStatus" />
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
So it's saying that OrderResponseDetailLow extends OrderResponseItem
and includes an OrderStatus.
I don't see anywhere where the wsdl states which type of thing will be
returned by the api call. The return type depends on what value I
pass in (like DetailLevel=Low returns an OrderResponseDetailLow,
DetailLevel=High returns an OrderResponseDetailHigh).
I hacked up the wsdl file to include all the fields and if I always
request High it now works. However, further on, any time this similar
thing is used (complexType that extends another complexType and adds
more fields to it using <sequence>) I have to hack the wsdl again. I
believe I can get this project done using this method, I'm just
curious whether I'm doing anything wrong or if this is a bug,
unsupported feature, or if the api itself is doing something weird
that it shouldn't be.
Thanks again,
Brian
On Mon, Feb 27, 2012 at 7:25 AM, Brian E. Lozier <brian at massassi.com> wrote:
> This is helpful. I read the documentation here:
>
> http://search.cpan.org/~markov/XML-Compile-1.24/lib/XML/Compile/Schema.pod#Handling_xsi:type
>
> Which gives this example:
>
> my %xsi_type_table =
> ( $base_type1 => [ $ext1_of_type1, $ext2_of_type2 ]
> , $base_type2 => [ $ext1_of_type2 ]
> );
>
> my $r = $schema->compile(READER => $type
> , xsi_type => \%xsi_type_table
> );
>
> Where can I find out what the various variables should contain? For
> example, what's a $base_type1 and an $ext1_of_type_1, are those object
> of some sort or strings, and if so, what should they contain?
>
> Thanks again,
> Brian
>
>
>
> On Sat, Feb 25, 2012 at 5:13 AM, Mark Overmeer <mark at overmeer.net> wrote:
>>
>> * Brian E. Lozier (brian at massassi.com) [120225 01:04]:
>> > Is the "extension" keyword not supported in this module? Does this section
>> > of the WSDL file look wrong at all? To me it looks fine but as I mentioned
>> > I'm no SOAP or XML expert.
>>
>> I expect your XML messages use xsi:type to indicate which of the
>> order types is returned (or do you see it's modern replacement
>> "substitutionGroup" in the schema or wsdl?). See the explanation of
>> the xsi_type parameter to XML::Compile::Schema::compile()
>> --
>> 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