Get All By Category Sample

Travel Codes Translator eBL provides the ability to retrieve a list of all items within a category. The Get All By Category function does not contain an XML request; rather, a text string is submitted. The entire SOAP request and response are shown below.

Note: Category names (such as MealService) are case sensitive.

Request

Explanation

Code

 

POST /gws/TravelCodesTranslator HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.0

Host: intgweb2

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 441

Authorization: Basic 1234567890AbCDeFGHIJ

 

<?xml version="1.0" encoding="UTF-8"?>

SOAP request header.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

xmlns directs the request to the appropriate namespace.

<soapenv:Body><GetAllByCategory xmlns="http://webservices.galileo.com/TravelCodesTranslator/">

Requests all items within the TicketingType category.

    <CategoryName>MealService</CategoryName>

Specifies that the response be returned in US English.

    <LanguageCode>en_US</LanguageCode>

Ends the request.

</GetAllByCategory>

</soapenv:Body>

</soapenv:Envelope>

Response

Explanation

Code

Begins SOAP header.

HTTP/1.1 200 OK

Date: Thu, 06 Feb 2003 22:54:15 GMT

Server: IBM_HTTP_SERVER/1.3.19.3  Apache/1.3.20 (Win32)

Connection: close

Content-Type: text/xml; charset=utf-8

Content-Language: en

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

Begins Get All By Category response.

<GetAllByCategoryResponse xmlns="http://webservices.galileo.com/TravelCodesTranslator/">

Lists all items (both the item code and complete name) within the TicketingType category.

  <GetAllByCategoryResult>
<GetAllByCategory>
   <MealService Code="-">No meal service</MealService>
    <MealService Code="B">Breakfast</MealService>
   <MealService Code="C">Alcohol no cost</MealService>
   <MealService Code="D">Dinner</MealService>
   <MealService Code="F">Food to buy</MealService>
   <MealService Code="H">Hot meal</MealService>
   <MealService Code="K">Continental breakfast</MealService>
   <MealService Code="L">Lunch</MealService>
   <MealService Code="M">Meal</MealService>
   <MealService Code="O">Cold meal</MealService>
   <MealService Code="P">Alcohol to buy</MealService>
   <MealService Code="R">Refreshment</MealService>

    <MealService Code="S">Snack</MealService>
</GetAllByCategory>
</GetAllByCategoryResult>

Ends response.

</GetAllByCategoryResponse>

</soapenv:Body>

</soapenv:Envelope>