Hello Rainer,
I'm currently on loan to the Delphi team to help out with some
COM issues
and someone brought this item to my attention as I worked on WebServices
until the D7 timeframe. Indeed there's a bug in the importer. We are unable
to distinguish the inline complex type 'items' in 'CartAddRequest':
<xs:complexType name="CartAddRequest">
<xs:sequence>
<xs:element name="CartId" type="xs:string" minOccurs="0" />
<xs:element name="HMAC" type="xs:string" minOccurs="0" />
<xs:element name="MergeCart" type="xs:string" minOccurs="0" />
<xs:element name="Items" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ASIN" type="xs:string" minOccurs="0" />
<xs:element name="OfferListingId" type="xs:string" minOccurs="0" />
<xs:element name="Quantity" type="xs:positiveInteger" minOccurs="0"
/>
<xs:element name="AssociateTag" type="xs:string" minOccurs="0" />
<xs:element name="ListItemId" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ResponseGroup" type="xs:string" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
from the top-level 'items' declared later:
<xs:element name="Items">
<xs:complexType>
<xs:sequence>
<xs:element name="TotalResults" type="xs:nonNegativeInteger"
minOccurs="0" />
<xs:element name="TotalPages" type="xs:nonNegativeInteger" minOccurs="0"
/>
<xs:element ref="tns:Item" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
The 'CartCreateRequest' type - like 'CartAddRequest' - also has an inline
'items'.
The problem is in the logic that maps a named array [in this case 'items']
to a class. That logic must be enabled for the top level type but not for
the nested ones. Unfortunately, we don't distinguish between the two and
enable it for the nested one as well. So you should be able to avoid the
AV
by turning off that mapping [i.e. by using the -Ok- switch]:
wsdlimp -Ok-
http://webservices.amazon.com/AWSECo...ceService.wsdl
However, the code generated will not work in cases where we need to
serialized an array with a specified name [since Pascal and C++ don't
provide for a way to associate a type name with an array [syntactically they
do but that information is not kept in the compiler's typeinfo about the
type] the array element name will be serialized with the wrong name].
Now, it is possible that the code generated might work for you if you are
not using some operations that involve named array types.
I've put in a fix to eliminate the
AV; however, a proper fix would involve
adding logic to distinguish between nested and top level types and not
confusing them. If time allows, I hope to check in a fix for this issue too
next week.
Regards,
Bruneau.