Reputation: 463
After using the old v2.0.0 we decided to upgrade the Sabre SOAP EnhancedSeatMap to v5.0.0. We use it as Web Reference (not service reference) to our C# .NET 4.5 project. When instancing the new upgraded service with:
var x = new EnhancedSeatMapService();
Exception:
Cannot convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail[]' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail'
error CS0030: Cannot convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail[]' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail'
error CS0030: Cannot convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail[]' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail'
error CS0030: Cannot convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail[]' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail'
error CS0029: Cannot implicitly convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail[]'
error CS0029: Cannot implicitly convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail[]'
error CS0029: Cannot implicitly convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Amenity_Detail[]'
error CS0029: Cannot implicitly convert type 'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail' to
'ServiceSupplier_Sabre.EnhancedSeatMapRQ.Price_AndTaxDescription_Detail[]'
On the Sabre API Documentation there is explicit statement that this version supports .net:
Please help
Upvotes: 0
Views: 216
Reputation: 1427
This is actually because a .NET bug that takes a sequence with a maxOccurs="1000" and instead of understanding it as 1000 limit, or simply as an array, .NET creates an array of arrays.
<xsd:complexType name="AmenityTable">
<xsd:sequence>
<xsd:element name="AmenityDetail" maxOccurs="1000" minOccurs="0" type="imap-0400:Amenity_Detail">
Here is the double array:
[System.Xml.Serialization.XmlArrayItemAttribute("AmenityDetail", typeof(Amenity_Detail), IsNullable=false)]
public Amenity_Detail[][] AmenityTable {
get {
return this.amenityTableField;
}
set {
this.amenityTableField = value;
}
}
You can simply download the WSDL with all the schemas and remove the maxOccurs="1000"
from both imap-0400:Amenity_Detail
and imap-0400:Price_AndTaxDescription_Detail
If not, you can use my modified version: https://files.fm/f/guzxxkkn
Upvotes: 4