Documentation of the CarRentalAgentService

CarRentalAgentService. Method 

Retrieves a geographic Region.

public RegionResponse (
   RegionRequest request
);

Parameters

RegionRequest
A RegionRequest containing the nessessary request data.

Return Value

A RegionResponse containing the requested Region.

Remarks

The GetRegion - Method is used to query a Region entity. A Region represents a geographic area which itself can contain Regions or Locations. In most cases, you will want to use a Region to narrow down to or specify a rental location.

To comprehend the responsibility of a Region within the complete car rental process, it may be helpful to imagine the regional structure as a tree-node-like datastructure:

The region datastructure as tree view

Fig: The region datastructure as tree view

Keeping this visualization in mind, a Region may have a parent region and a root region. The root region is the topmost (aka first-level, country level) region. In consequence, a Region also may contain one or more child regions. This way, a tree-node-like datastructure (composite) is designed.

Moreover, it is important to know that a Region may have assigned one or more Locations. a Location is a physical geographic point which represents a car rental facility or office. If a Region has Locations assigned, you may use the GetLocations - Method using this region to aquire all assigned locations.

As a result, a Region has two major reponsibilities within the complete car rental process:

  1. Help and simplify finding a car rental location - This is the primary goal in using a Region. Starting from a root region, you can descend the regional tree-node-structure until you find regions which have Locations assigned (see HasLocations property).
  2. Using a deep-leveled, location-assigned region to request Rates - The second responsibility is probably one of the most exciting and unique features of CarRentalAgentService

    Once you have found a region having locations assigned, you may use this region directly to request Rates (using GetRates - Method). This way, you can query rates for a whole region instead of querying for a specific location. This functionality has major advantages and affects the complete car rental process.

    For a detailed discussion about this regional rate query principle, see CarRentalAgentService SDK - Reference Manual

Common Use Case Scenarios

Use Case Scenario Resolution Path
You want to check and obtain a region for an Airport, because the user has entered his destination airport where he wants a car rental.
  1. Check if the entered airport is supported by Sunny Cars using GetAirports - Method, unless you already have proven support.
  2. Query Region with AirportCode set to the three letter IATA code of the requested airport (see Code).

List Of defined call-variants

parameters GetRegionP1 GetRegionP2
token required required
id required not applicable
airportCode not applicable required
languageCode optional optional
withChilds obsolete obsolete



Description : This variant returns the region identified by the given id. This variant returns the region identified by the given airportCode.

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_REGION_NOT_FOUND The requested region cannot be found.

This error occurs if:

  • There is no region exisiting with specified region id.

E_AIRPORT_NOT_FOUND The associated airport for specified airport code was not found.
E_REQUEST_AMBIGIOUS The performed request ambigious.

This error occurs if:

  • Both AirportCode and RegionId were passed.
  • Neither AirportCode nor RegionId 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: Loading a Region with Id 96 (Bavaria) with all child regions and in dutch language.

[C#]
RegionRequest rq = new RegionRequest();

rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Test;
rq.Id = 96;
rq.LanguageCode = "NL";
rq.WithChilds = true;

RegionResponse rs = this.service.GetRegion(rq);

Region bavaria = rs.Region;

See Also

CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace