Known Issues With Web Services Tools
This page lists known issues for specific Web Services tools when they are used for Universal API development.
.NET Tools
There are known issues when using .NET tools, such as Microsoft Visual Studio, with Universal API:
For some Web Services tools, particularly .NET tools such as Microsoft Visual Studio, the Web Service proxy generator creates a complex object relationship when handling choice elements in the schema. The proxy generator handles the choice element by returning either a shared base class for the choices, or, if the choices do not share a common base class, an object.
However, some .NET tools do not support the use of the choice complex type, which is used regularly throughout the Universal API to denote mutually exclusive data options. As a result, when choice elements are used in Universal API, Visual Studio and other tools import these elements as a generic Items property. For example, a choice between SearchAirLeg and SearchSpecificAirSegment is turned into an .Item (or .Items) property, effectively hiding the two options:
[System.Xml.Serialization.XmlElementAttribute("SearchAirLeg", typeof(SearchAirLeg), Order=0)]
[System.Xml.Serialization.XmlElementAttribute("SearchSpecificAirSegment", typeof(SearchSpecificAirSegment), Order=0)]
public object[] Items {…
Because the property is generic, the schema must be referenced to understand the data that must go into the Items property.
To resolve this issue, you can choose to transform xs:choice in the schema files into xs:sequence, which is typically supported by .NET tools. Using the sequence element allows all of the elements to be seen in the code; the desired element can then be set for the request. As an alternative, you should refer to the schema every time you see a property with the name Item in the proxy classes within Visual Studio.
However, unlike the choice element, sequence allows more than one element to be sent in the request. For example, the use of xs:sequence allows both the mutually exclusive SearchDepTime and SearchArvTime to be included in the same Air Availability request:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AvailabilitySearchReq xmlns="http://www.travelport.com/schema/air_v50_0">
<SearchAirLeg>
<SearchOrigin>
<Airport Code="CPH" xmlns="http://www.travelport.com/schema/common_v50_0"/>
</SearchOrigin>
<SearchDestination>
<Airport Code="LHR" xmlns="http://www.travelport.com/schema/common_v50_0"/>
</SearchDestination>
<SearchDepTime PreferredTime="2010-10-10"/>
<SearchArvTime PreferredTime="2010-10-20"/>
</SearchAirLeg>
</AvailabilitySearchReq>
</s:Body>
</s:Envelope>
As a result, this loss of limitations to set options should be considered in the client design when xs:choice is transformed into xs:sequence in the XML schema.
If you send several elements where the schema has a choice, Universal API returns an error. The error message you receive when sending the request to the copy system is similar to:
<?xml version="1.0" encoding="utf-16"?>
<SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>Server.InvalidRequestException</faultcode>
<faultstring>[Error] :1:112: cvc-complex-type.2.4.a: Invalid content was found starting with element 'SearchAirLeg'. One of '{"http://www.travelport.com/schema/common_v50_0":BillingPointOfSaleInfo}' is expected.</faultstring>
<detail>
<ErrorInf xmlns="http://www.travelport.com/schema/air_v50_0">
<Code>1000</Code>
<Service>WEBSVC</Service>
<Type>Data</Type>
<Description>Validation failed on request message.</Description>
<TransactionId>73603EDB0A076114015763676AF2D5AE</TransactionId>
<Auxdata>
<Entry>
<Reason>LastElement</Reason>
<Description>AvailabilitySearchReq</Description>
</Entry>
</Auxdata>
</ErrorInfo>
</detail>
</SOAP:Fault>
It is important to ensure that only one element is sent, even if the xs:choice is changed to xs:sequence.
Imported schemas may contain double square brackets; this is a limitation with the way WSDL files are converted by Microsoft Visual Studio.
To work around this problem, after importing the files, perform a global search for [][] and replace with []. In Visual Studio 2010 this can be done by selecting Edit > Find and Replace > Replace in Files.
The global search and replace is typically required once per namespace.