private static void ShowRateReply(RateReply reply)
        {
            Console.WriteLine("RateReply details:");
            for (int i = 0; i < reply.RateReplyDetails.Length; i++)
            {
                RateReplyDetail rateReplyDetail = reply.RateReplyDetails[i];
                Console.WriteLine("Rate Reply Detail for Service {0} ", i + 1);
                if (rateReplyDetail.ServiceTypeSpecified)
                    Console.WriteLine("Service Type: {0}", rateReplyDetail.ServiceType);
                if (rateReplyDetail.PackagingTypeSpecified)
                    Console.WriteLine("Packaging Type: {0}", rateReplyDetail.PackagingType);

                for (int j = 0; j < rateReplyDetail.RatedShipmentDetails.Length; j++)
                {
                    RatedShipmentDetail shipmentDetail = rateReplyDetail.RatedShipmentDetails[j];
                    Console.WriteLine("---Rated Shipment Detail for Rate Type {0}---", j + 1);
                    ShowShipmentRateDetails(shipmentDetail);
                    ShowPackageRateDetails(shipmentDetail.RatedPackages);
                }
                ShowDeliveryDetails(rateReplyDetail);
                Console.WriteLine("**********************************************************");
            }
        }
 private static void ShowNotifications(RateReply reply)
 {
     Console.WriteLine("Notifications");
     for (int i = 0; i < reply.Notifications.Length; i++)
     {
         Notification notification = reply.Notifications[i];
         Console.WriteLine("Notification no. {0}", i);
         Console.WriteLine(" Severity: {0}", notification.Severity);
         Console.WriteLine(" Code: {0}", notification.Code);
         Console.WriteLine(" Message: {0}", notification.Message);
         Console.WriteLine(" Source: {0}", notification.Source);
     }
 }
        private static IEnumerable<DeliveryOption> BuildDeliveryOptions(RateReply rateReply, IShipment shipment)
        {
            var optionCollection = new DeliveryOptionCollection();
            foreach (var rateReplyDetail in rateReply.RateReplyDetails)
            {
                var service = rateReplyDetail.ServiceType.ToString();

                optionCollection.AddRange(rateReplyDetail.RatedShipmentDetails.Select(shipmentDetail => shipmentDetail.ShipmentRateDetail.TotalNetCharge.Amount).Select(rate => new DeliveryOption { Rate = rate, Service = service }));
            }

            return optionCollection;
        }