Where’s my seat?

Summary: Sabre TravelItineraryReadService TravelItineraryReadRQ version 2.2.0 returns incomplete Seat data. TravelItineraryReadRQ version 3.4.0 returns all of the Seat data.

I had bug in my PNR capture code – it was throwing an exception on my persist flight details stored procedure call because I wasn’t giving it a required seat number. It was a trivial code fix, I needed to pass an empty string to the stored procedure (not a null value).

But did I have a bug further upstream in my TravelItineraryReadRS parsing and mapping code? Or is the data really missing?

My current version of the TravelItineraryReadService is using TravelItineraryReadRQ version 2.2.0. Below is the snippet from the TravelItineraryReadRS. You can see that it’s only returning a seat number for segment 2, all of the other segments have no value for the seat number – the attribute is missing entirely. So I don’t have any parsing/mapping issues, sabre isn’t giving me the data.

<TravelItineraryReadRS Version="2.2.0">
...
  <Seats>
	<Seat NameNumber="01.01" SegmentNumber="0001" Status="HRQ">
	  <FlightSegment>
		<DestinationLocation LocationCode="PHX" />
		<OriginLocation LocationCode="SBA" />
	  </FlightSegment>
	</Seat>
	<Seat Changed="N" NameNumber="01.01" Number="04A" SegmentNumber="0002" SegmentStatus="HK" SmokingPreference="N" Status="HRS" TypeTwo="WLMI">
	  <FlightSegment>
		<DestinationLocation LocationCode="ORD" />
		<OriginLocation LocationCode="PHX" />
	  </FlightSegment>
	</Seat>
	<Seat NameNumber="01.01" SegmentNumber="0003" Status="HRQ">
	  <FlightSegment>
		<DestinationLocation LocationCode="PHX" />
		<OriginLocation LocationCode="ORD" />
	  </FlightSegment>
	</Seat>
	<Seat NameNumber="01.01" SegmentNumber="0004" Status="HRQ">
	  <FlightSegment>
		<DestinationLocation LocationCode="SBA" />
		<OriginLocation LocationCode="PHX" />
	  </FlightSegment>
	</Seat>
  </Seats>
...
</TravelItineraryReadRS>

I’m in the middle of evaluating (and implementing) TravelItineraryReadRQ version 3.4.0. Cool, it has my seat data! Maybe I need to roll this into production sooner than planned…

<TravelItineraryReadRS Version="3.4.0">
...
  <Seats>
	<Seat Changed="N" NameNumber="01.01" Number="02A" SegmentNumber="0001" SegmentStatus="PN" SmokingPreference="N" Status="HRS" TypeTwo="">
	  <FlightSegment>
		<DestinationLocation LocationCode="PHX" />
		<OriginLocation LocationCode="SBA" />
	  </FlightSegment>
	</Seat>
	<Seat Changed="N" NameNumber="01.01" Number="04A" SegmentNumber="0002" SegmentStatus="HK" SmokingPreference="N" Status="HRS" TypeTwo="WLMI">
	  <FlightSegment>
		<DestinationLocation LocationCode="ORD" />
		<OriginLocation LocationCode="PHX" />
	  </FlightSegment>
	</Seat>
	<Seat Changed="N" NameNumber="01.01" Number="03A" SegmentNumber="0003" SegmentStatus="PN" SmokingPreference="N" Status="HRS" TypeTwo="">
	  <FlightSegment>
		<DestinationLocation LocationCode="PHX" />
		<OriginLocation LocationCode="ORD" />
	  </FlightSegment>
	</Seat>
	<Seat Changed="N" NameNumber="01.01" Number="03F" SegmentNumber="0004" SegmentStatus="PN" SmokingPreference="N" Status="HRS" TypeTwo="">
	  <FlightSegment>
		<DestinationLocation LocationCode="SBA" />
		<OriginLocation LocationCode="PHX" />
	  </FlightSegment>
	</Seat>
  </Seats>
...
</TravelItineraryReadRS>

HTTPS WCF web service web config

Here’s the web config for a WCF web service. I struggled getting it to work under HTTPS. But when all done and working it’s not terrible – I’ll try to highlight the relevant names because that was my primary struggle point. I won’t go into explaining everything, there are tons of posts out there can (and do) explain much better than I can or want to here.

WebConfig

I pieced together several different examples in an attempt to get this working and at first my highlighted names didn’t match – and no luck working. So here are the highlighted sections of the serviceModel element with the names matching up.

See ServiceBehaviorA, wsHttpBinding, and TransportSecurity. These are referenced in the endpoint and must also be referenced in the behaviors and bindings elements.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  <system.serviceModel>
 
    <services>
      <service name="S2C.API.Service" 
 
               <!-- SEE BELOW in serviceBehaviors -->
               behaviorConfiguration="ServiceBehaviorA">
 
        <endpoint address="" 
 
                  <!-- SEE BELOW in bindings -->
                  binding="wsHttpBinding"
 
                  <!-- SEE BELOW the binding name -->
                  bindingConfiguration="TransportSecurity"
 
                  contract="S2C.API.IService" />
 
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" />
      </service>
    </services>
 
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviorA">
 
          <!-- To avoid disclosing metadata information, 
               set the value below to false and remove 
               the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
 
          <!-- To receive exception details in faults for debugging purposes, 
               set the value below to true. Set to false before deployment 
               to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
 
        </behavior>
      </serviceBehaviors>
    </behaviors>
 
    <bindings>
      <wsHttpBinding>
        <binding name="TransportSecurity">
 
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
 
        </binding>
      </wsHttpBinding>
    </bindings>
 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
 
  </system.serviceModel>

Frustration …

Frustrated with Sabre web services, grrrrr!

The version of the TravelItineraryRead web service I’m using is “2003A.TsabreXML1.15.1”. Yes, I know its a bit dated but it fits the needs .. until recently. I’m seeing more Rail segments come across and this version does not support them. So, I wanted to test the latest TravelItineraryRead version to see how or if Rail is supported. 

So I built my proxy classes using 
wsdl.exe  http://webservices.sabre.com/wsdl/tpfc/TravelItineraryReadLLS2.2.0RQ.wsdl  /namespace:OTA_TravelItineraryReadNS2_2_0
And setup my code to call the new service  

1
2
3
4
5
. . .
var serviceObj = new TravelItineraryReadService();
serviceObj.MessageHeaderValue = msgHeader;
serviceObj.Security = security;
TravelItineraryReadRS response = serviceObj.TravelItineraryReadRQ(req);

… and I get a null response. No errors or exceptions just a null response. So, I tweak my objects and try again – same null response. Make more changes – same null response. I go through several cycles of this and I’m stuck, I need help – another set of eyes to see what I’m doing wrong. (BTW, Sabre’s documentation on this web service is horrible. This is the root of my problem)

Next I contact Sabre’s web services support through email. This is my frustration … The email conversation goes on for 6 days. Maybe their support group is outside the USA or their policy it to email a maximum of a few times per day. Whichever the case, it is painfully slow dealing with them. The end result of this painfully slow email conversation is nothing, nada, zip, still getting null. The support group doesn’t have aqueduct documentation, no code samples, no code ownership and certainly no expertise.

 Long story shortened, this was my problem:

1
2
3
4
5
6
7
8
9
10
11
12
13
MessageHeader msgHeader = new MessageHeader();
 
// If the msgHeader.Action is not exactly 
// "TravelItineraryReadLLSRQ"
// your response will be null
msgHeader.Action = "TravelItineraryReadLLSRQ";
 
Service service = new Service();
service.Value = "TravelItineraryReadLLSRQ"; // THIS IS NOT USED!!!
service.type = "this object can be null";
msgHeader.Service = service; // THIS CAN BE NULL, IT'S NOT USED
 
. . .

Now I can finally start my research on Rail segments!!

There are not many “open” resources available for Sabre web services. I’ve written a lot of code to consume them…. contact me if you are stuck, maybe I can help.