Reading the GetReservationRQ xml

Richard C

Working on a SABRE webapp for our company. I'm a complete beginner and I've made the SOAP call to get back GetReservationRQ. No problem. Physically I can see and read the xml. What's the best practice approach to reading through the xml and getting it into practical use within state. I would prefer to convert it to json and work with it there, but that appears to be very little I can comprehend about converting it. What techniques do you use? Example: I want to grab the for grab the stl19:AccountingLines element and the child nodes and convert those to json... Sorry this is a basic question... but nothing is easy when you're starting out...

Manjula Liyanage

You can get the XML schema from the developer studio and use some tool to convert the schemat to class files (this depends on your programming language). Once you have the classes then you can serialize/deserialize XML to object and vice versa. If your language doesn't have this type of support, you can use XPATH to read the XML and parse the message.

Example:

node = xmlRQ.SelectSingleNode("//soap:Body/a:DebitPointsRQ/a:LoyaltyMembershipID", nsmgr);
            if (node != null && node.InnerText != string.Empty)
                _debitRequest.LoyaltyMembershipID =node.InnerText;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related