Documentation of the CarRentalAgentService

Status Class

The Status class incorporates information about the status of an operation. An instance of Status is typically embodied in an operational Response.

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

System.Object
   Data
      Status

public class Status : 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

If you perform an operation through CarRentalAgentService, the operation will return a Response object containing an instance of Status class. You can query the information in Status to check wether your requested operation was successful, contains any WarningMessages or if the operation failed due to some ErrorMessages while processing your requested operation.

Example

A simple way to check the operational status is described below.

[C#]
RegionRequest rq = new RegionRequest();
rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Test;
rq.Id = 5;
rq.LanguageCode = "EN";
rq.WithChilds = true;

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

if (rs.Status.Code == StatusCode.Failure) //something fatal happened
{
    foreach (ErrorMessage e in rs.Status.ErrorMessages)
    {
        this.textBoxErrors.Text += String.Format("Error {0}: {1}\r\n", e.Number, e.Code);
    }
} 
else if (rs.Status.Code == StatusCode.Success) //operation was ok
{
    //althoug successful, maybe some warnings occured
    foreach (WarningMessage w in rs.Status.WarningMessages)
    {
        this.textBoxWarnings.Text += String.Format("Warning {0}: {1}\r\n", w.Number, w.Code);
    }
}

Requirements

Namespace: SunnyCars.Schema.Osi.WsReservation.V4

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

See Also

Status Members | SunnyCars.Schema.Osi.WsReservation.V4 Namespace