Documentation of the CarRentalAgentService

CarRentalAgentService. Method 

Retrieves a service Ticket.

public TicketResponse (
   TicketRequest request
);

Parameters

TicketRequest
A TicketRequest containing the nessessary authentication data.

Return Value

A TicketResponse containing the Ticket with token.

Remarks

Use this method to obtain a service ticket. A service ticket is required to call any method from this service which is not part of the authentication procedure.

This method is the last step of the authentication procedure described in the CarRentalAgentService SDK - Reference Manual.

In return, you will get a Ticket which is the service ticket. You will have to use the Token to create any valid Request to the CarRentalAgentService.

Tip:

In most cases, you will call more than one method of this service using a valid Ticket. Therefore, you should consider to save the returned Ticket in your client implementation. Depending on concurrency and use of your client, you may save the Ticket or its Token in a user ticket.

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_AUTHENTICATION_FAILED The authentication procedure has failed.

This error occurs if:

  • The identity of the operator could not be proven.
  • The provided secret is in invalid format.
  • The provided secret is not decryptable.
  • The associated operator was not found.
  • The associated operator has not enough permissions.
  • The associated operator contract is expired.
  • The operator has a weak passphrase for encryption.

E_IMPERSONATION_FAILED The requested impersonation has failed.

This error occurs if:

  • The target agency for the impersonation was not found.
  • The target agency is not allowed to be target of an impersonation.
  • The operator has no permissions to impersonate.
  • The operator has no permissions to impersonate on behalf of target agency.

E_REQUEST_INVALID The performed request is invalid or malformed.

Example

Obtaining a service ticket.

[C#]
TicketGrantingRequest grantRq = new TicketGrantingRequest();
rq.OperatorKey = "000000";

TicketGrantingResponse grantRs = this.carAgent.GetTicketGrantingTicket(grantRq);
TicketGrantingTicket grant = rs.TicketGrantingTicket;

grant.Secret = this.secretGenerator.CreateResponseSecret(grant.Secret);

TicketRequest serviceRq = new TicketRequest();
serviceRq.TicketGrantingTicket = grant;

TicketResponse serviceRs = this.carAgent.GetTicket(serviceRq);

this.serviceTicket = serviceRs.Ticket;

See Also

CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace