Documentation of the CarRentalAgentService

Ticket Class

This class represents a service ticket (security token) which is required to perform any operation on CarRentalAgentService interface.

For a list of all members of this type, see Ticket Members.

System.Object
   Data
      Ticket

public class Ticket : Data

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The CarRentalAgentService is a non-public service. Only registered partners of Sunny Cars are eligible to use the service. To utilize the CarRentalAgentService, you must authenticate yourself as a valid consumer of the service. The authentication process is integrated in CarRentalAgentService. Consult the "CarRentalAgentService SDK - Reference Manual" for details about the authentication procedure.

Once you have passed the authentication procedure, the service will return you an instance of this Ticket class. This Ticket is required for each call of any operation provided by the CarRentalAgentService.

Consequently, you are required to specify a valid service ticket within an operational request for every called operation.

A Ticket contains the security token used by the CarRentalAgentService to verify authorization as well as the creation time (Timestamp) and expiration time (Expires). It is recommended for any operator/client implementation to check the expiration time of the provided service ticket to have knowledge how long the service ticket can be used to perform any operation against the CarRentalAgentService.

Example

Checking if a given service ticket is valid - if so, use the service ticket to perform an operation.

[C#]
// we previously have requested a service ticket from service(see: TicketGrantingTicketRequest),
// now we check if our ticket is valid
Ticket ticket = this.serviceTicket;

if (DateTime.ParseExact(ticket.Expires, "s", CultureInfo.InvariantCulture) < DateTime.Now)
{
    Console.WriteLine("Uuups, Ticket expired.");
}
else
{
    Console.WriteLine("Ticket ok, go for it.");
    
    RegionsRequest rq = new RegionsRequest();
    rq.Operation.Target = OperationTarget.Production;
    rq.Ticket = ticket;
    
    RegionsResponse rs = this.carAgent.GetRegions(rq);
    this.serviceTicket = rs.Ticket;
    
    ...
    ...
    ...
}

Requirements

Namespace: SunnyCars.Schema.Osi.WsReservation.V4

Assembly: Sunnycars.Schema.Osi.WsReservation.V4 (in Sunnycars.Schema.Osi.WsReservation.V4.dll)

See Also

Ticket Members | SunnyCars.Schema.Osi.WsReservation.V4 Namespace | TicketRequest | TicketResponse