Documentation of the CarRentalAgentService

CarRentalAgentService. Method 

Retrieves a set of car rental Locations.

public LocationsResponse (
   LocationsRequest request
);

Parameters

LocationsRequest
A LocationsRequest containing the nessessary request data.

Return Value

A LocationsResponse containing the requested Locations.

Remarks

Use this method to get a set of Locations based upon specific data. The GetLocations method is one of the most important methods within the car rental process.

The main functionality of this method is to return you a list of locations for a specific Region. Since the Region is only a grouping entity for locations, you can utilize this method to get the concrete Location members of a Region.

Moreover, you are able to query the corresponding arrival Locations for a specific Location.

It is worth to note that this method includes so called checking rules, which will allow you to get "checked" Locations in response. Within the car rental process "checked" only means that some preferences or business constraints have been proven for validity before the response is returned. GetLocations supports following checking rules.

Location Meeting Type Checking

This checking rule is the location meeting type checking rule. By specifying any of the location meeting preferences (MeetingAtAirportPreference, MeetingAtCounterPreference, MeetingAtSpecialAddressPreference) you tell the Web Service to check on the meeting service availability of the affected locations and only return those, who effectively provide the preferred meeting type(s).

This rule is very important to validate that both the customer preference is met and the selected location is ready for a Reservation request.

Note   Attention!

The determination and specification of location meetings is essential to the complete car rental process. To perform a Reservation, you will need to specify the type of location meeting used upon departure and arrival.

Common Use Case Scenarios

Use Case Scenario Resolution Path
You want to find all locations for a specific Region. Query locations with RegionId set to the id of the region where locations should be loaded.
You want to find all arrival locations for a specific Location. Query locations with LocationId set to the id of the departure location for which arrival locations should be loaded.
You want to find locations for a specific departure Airport. Query locations with AirportCode set to the three letter IATA airport code.
Your customer prefers to leave his car at the hotel where he spents his holiday. Query arrival locations with LocationId set to the id of the selected departure location and MeetingAtSpoecialAddressPreference set to Required.
You already have displayed your customer some offers / rates using the "regional rate query" (best-buy) method. Your customer has selected its preferred rate and now wants to continue the reservation process. You want to find all locations where the selected car is available. Query locations with VehicleId set to the id of the selected vehicle, RateServiceTypeId set to the rate service type of the selected rate, and RegionId set to the departure region id.

List Of Errors Returned

Error Code Description
E_INTERNAL_SERVICE An internal service error occured during the process.
E_TICKET_TOKEN_INVALID The provided token is invalid.

This error occurs if:

  • The token is in invalid format.
  • The token is expired.
  • The token was not found.

E_LOCATION_NOT_FOUND The requested locations cannot be found.

This error occurs if:

  • There are no locations exisiting with given region id.
  • There are no arrival locations existing with given departure location id.

E_DEPARTURE_LOCATION_NOT_FOUND The given departure location cannot be found.
E_REGION_NOT_FOUND The given region cannot be found.
E_AIRPORT_NOT_FOUND The given airport cannot be found.
E_VEHICLE_NOT_FOUND The given vehicle / rate service type cannot be found.
E_REQUEST_AMBIGIOUS The performed request ambigious.

This error occurs if:

  • Both LocationId and RegionId parameters were passed.
  • Both LocationId and VehicleId parameters were passed.
  • Both LocationId and RateServiceTypeId parameters were passed.
  • Both LocationId and AirportCode parameters were passed.
  • Both RegionId and AirportCode parameters were passed.
  • Neither LocationId, RegionId, AiportCode nor VehicleId parameters were passed.

E_REQUEST_INVALID The performed request is invalid or malformed.

List Of Warnings Returned

Warning Code Description
W_LANGUAGE_NOT_SUPPORTED The requested language code is not supported for localization. Using default language instead.

Example

Example: Get all locations for region Munich supporting airport and counter meeting type.

[C#]
LocationsRequest rq = new LocationsRequest();
rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Production;

// set request preferences
rq.RegionId = 595; // munich
rq.MeetingAtAirportPreference = Preference.Required;
rq.MeetingAtCounterPreference = Preference.Required;

LocationsResponse rs = this.service.GetLocations(rq);

Console.WriteLine("Locations in Munich with airport and counter meeting types:");

foreach (Location loc in rs.Location) 
{
    Console.Write("{0}, supports ", loc.Name);
    
    if (loc.LocationMeetingsSupported.AtAirport && loc.LocationMeetingsSupported.AtCounter)
    {
        Console.WriteLine("airport and counter type.");
    }
    else if (loc.LocationMeetingsSupported.AtAirport)
    {
        Console.WriteLine("airport type.");
    }
    else if (loc.LocationMeetingsSupported.AtCounter)
    {
        Console.WriteLine("counter type.");
    }
}

See Also

CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace