Einzelnen Beitrag anzeigen

Benutzerbild von r_kerber
r_kerber

Registriert seit: 11. Feb 2003
Ort: Trittau
3.538 Beiträge
 
Delphi XE Professional
 
#19

Re: Probleme beim import von WSDL Datei

  Alt 7. Sep 2005, 15:46
Moin Robert,

Zitat von Robert_G:
Der Wisdel-Importer von D7 hat ja schon damals auch nicht alles kapiert und dank Delphis phänomenal unsinniger single pass Einschränkung geht sicher auch in .Net ganz gerne was daneben...
Das Problem liegt nicht nur nur an dem rudimentären WSDL-Importer von D7 sondern auch an bestimmten Spracheinschränkungen der Delphi-Language. Für Dich poste ich hier mal die kompletten Antworten, die ich von Borland erhalten habe:
Zitat:
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.
und
Zitat:
Good morning!

Yes, please feel free to post the answer. I still want to stress that while
using -Ok- will avert the AV, the code generated will not be OK for
serializing the type 'Items' [and other named array types]. Also, if it's
helpful I'll be more than happy to post the correctly imported unit once I
put in a fix to the importer.

Regards,

Bruneau.
  Mit Zitat antworten Zitat