Esempio n. 1
0
        public FedexTrackService.TrackRequest CreateFedexTrackRequest(string key, string password, string accountNumber, string meterNumber, string trackingNumber)
        {
            // Build the TrackRequest
            FedexTrackService.TrackRequest request = new FedexTrackService.TrackRequest();
            request.WebAuthenticationDetail = CreateFedexAuthentication(key, password);

            request.ClientDetail = new ClientDetail()
            {
                AccountNumber = accountNumber,
                MeterNumber   = meterNumber
            };

            request.TransactionDetail = new TransactionDetail();
            request.TransactionDetail.CustomerTransactionId = "***Tracking using UtilAPI***";  //This is a reference field for the customer.  Any value can be used and will be provided in the response.
            request.Version = new VersionId();

            // Tracking information
            request.SelectionDetails = new TrackSelectionDetail[1] {
                new TrackSelectionDetail()
            };
            request.SelectionDetails[0].PackageIdentifier       = new TrackPackageIdentifier();
            request.SelectionDetails[0].PackageIdentifier.Value = trackingNumber; //tracking number or door tag
            request.SelectionDetails[0].PackageIdentifier.Type  = TrackIdentifierType.TRACKING_NUMBER_OR_DOORTAG;

            // Date range is optional.
            // If omitted, set to false

            // Include detailed scans is optional.
            // If omitted, set to false
            request.ProcessingOptions    = new TrackRequestProcessingOptionType[1];
            request.ProcessingOptions[0] = TrackRequestProcessingOptionType.INCLUDE_DETAILED_SCANS;
            return(request);
        }
Esempio n. 2
0
        public TrackReply GetFedexTrack(FedexTrackService.TrackRequest request)
        {
            TrackReply reply = null;

            FedexTrackService.TrackService svc = new FedexTrackService.TrackService();
            reply = svc.track(request);

            return(reply);
        }