Joanna
Joanna

Reputation: 53

Unable to retrieve data from Sabre PriceQuoteServicesRQ 4.10 SOAP API: XML request schema validation failed: PriceQuoteInfo element is not complete

I have a problem when trying to retrieve data from Manage Price Quote Details (PriceQuoteServicesRQ) 4.10 Sabre SOAP API.

I generated Java classes using the WSDL from Sabre website (https://developer.sabre.com/docs/soap_apis/air/fulfill/manage_price_quote_details/resources).

I am constructing my request object in a following way:

      ReservationTypeShort reservation = new ReservationTypeShort();
      reservation.setValue("YEZUYS");

      PriceQuoteInfoSearchParameters info = new PriceQuoteInfoSearchParameters();
      info.setReservation(reservation);

      PriceQuoteSearchParameters searchParameters = new PriceQuoteSearchParameters();
      searchParameters.getPriceQuoteInfo().add(info);
      searchParameters.setResultType(StringResultType.S);

      GetPriceQuoteRQ req = new GetPriceQuoteRQ();
      req.setSearchParameters(searchParameters);
      req.setVersion("4.1.0");

I pretty-printed the object and this is what I got:

      "priceQuoteInfo" : [ {
      "reservation" : {
        "value" : "YEZUYS",
        "createDate" : null
      },
      "status" : [ ],
      "type" : null,
      "priceQuote" : [ ],
      "travelItinerary" : null
    } ],

So according to their documentation: sabre docs I am supplying all fields that are necessary, however it still doesn't work for me.

Did anybody else had the same problem? What am I missing/what am I doing wrong?

This is the error message I am getting:

XML request schema validation failed: PriceQuoteInfo element is not complete. One of the following fields: Status, Type, PriceQuote, TravelItinerary should be used. Please amend your request and try again.

What I have tried so far?

I intercepted the XML body:

      <ns5:GetPriceQuoteRQ version="4.1.0">
         <ns5:SearchParameters resultType="S">
            <ns5:PriceQuoteInfo>
               <ns5:Reservation>YEZUYS</ns5:Reservation>
            </ns5:PriceQuoteInfo>
         </ns5:SearchParameters>
      </ns5:GetPriceQuoteRQ>

Upvotes: 0

Views: 438

Answers (2)

Joanna
Joanna

Reputation: 53

I was missing an empty element <PriceQuote/> in my request.

It can be added by doing:

PriceQuoteInfoSearchParameters info = new PriceQuoteInfoSearchParameters();
info.setReservation(reservation);
info.getPriceQuote().add(new PriceQuoteSearch());

Upvotes: 1

Bogdan
Bogdan

Reputation: 24590

So according to their documentation I am supplying all fields that are necessary [...]

By documentation do you mean the WSDL or some human readable documentation (like PDF, DOCX, web pages, etc)? According to the error message you get, your SOAP request isn't valid. Sabre Support responding with "it works on my end" is another way of saying that you are not doing something correctly on your end. You need to troubleshoot your request.

From what I see, the error message is saying Status, Type, PriceQuote, and TravelItinerary but you are sending status, type, priceQuote, and travelItinerary. XML is case sensitive, and it's possible the service field names are too, so this might be the first thing to check.

Then, two of your fields (type and travelItinerary) are null. Also, priceQuote is empty. Is that OK? This is the next thing to check.

The object you pretty-printed shows a JSON format. Is this actually the format you are sending on the wire to the service? SOAP wants XML, not JSON. You also mention you generated the code from the WSDL. Using what framework or library? Does the generated code send XML?

Like I said, you need to troubleshoot the call:

  1. download SoapUI
  2. feed the WSDL file to SoapUI so that it can generate sample requests for you
  3. fill in those request with real data and make calls to the web service until you get back a successful and expected response
  4. using the same parameters from 3) in your code, perform the same call using your code
  5. use SoapUI's monitoring tools to intercept the request at 4) and inspect the SOAP message you are sending
  6. check the request you are making with your code against the successful request you got by using SoapUI directly
  7. correct any differences until your request made by code is like the one send from SoapUI and it returns a successful and expected response.

Upvotes: 0

Related Questions