Esempio n. 1
0
        private static void runCreateShipmentOrderRequest(GKVAPIServicePortTypeClient port, AuthentificationType auth)
        {
            CreateShipmentOrderRequest Request = GeschaeftskundenversandRequestBuilder.createDefaultShipmentOrderRequest();

            try
            {
                CreateShipmentOrderResponse shResponse = port.createShipmentOrder(auth, Request);

                //Response status
                Statusinformation status         = shResponse.Status;
                String            statusCode     = status.statusCode;
                String            statusText     = status.statusText;
                String            Shipmentnumber = shResponse.CreationState[0].LabelData.shipmentNumber;
                //Label URL
                Object labelURL = shResponse.CreationState[0].LabelData.Item;

                Console.Write("CreateShipmentDDRequest: \n" +
                              "Request Status: Code: " + statusCode + "\n" +
                              "Status-Nachricht: " + statusText + "\n" +
                              "Label URL: " + labelURL + "\n" +
                              "Shipmentnumber: " + Shipmentnumber + "\n");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Each key terminates the Program!");
                String wait = Console.ReadLine();
                Environment.Exit(0);
            }
        }
Esempio n. 2
0
        private static void runGetLabelRequest(GKVAPIServicePortTypeClient port, AuthentificationType auth)
        {
            Console.WriteLine("Sendungsnummer eingeben:");
            String Sendungsnummer = Console.ReadLine();

            GetLabelRequest Request = GeschaeftskundenversandRequestBuilder.getDefaultLabelRequest(Sendungsnummer);

            try
            {
                GetLabelResponse lblResponse = port.getLabel(auth, Request);

                //Response status
                Statusinformation status        = lblResponse.Status;
                String            statusMessage = status.statusText;
                LabelData[]       lblDataList   = lblResponse.LabelData;

                Console.Write("geLabelDDRequest: \n" +
                              "Status-Nachricht: " + statusMessage + "\n");

                foreach (LabelData lblData in lblDataList)
                {
                    Console.Write("Sendungsnummer: " + lblData.shipmentNumber + "\n" +
                                  "Status: " + lblData.Status.statusText + "\n" +
                                  "Label URL: " + lblData.Item + "\n");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Jede Taste beendet das Program!");
                String wait = Console.ReadLine();
                Environment.Exit(0);
            }
        }
Esempio n. 3
0
        private static void runDeleteShipmentRequest(GKVAPIServicePortTypeClient port, AuthentificationType auth)
        {
            Console.WriteLine("enter tracking number:");
            String Sendungsnummer = Console.ReadLine();
            DeleteShipmentOrderRequest ddRequest = GeschaeftskundenversandRequestBuilder.getDeleteShipmentOrcerRequest(Sendungsnummer);

            try
            {
                DeleteShipmentOrderResponse delResponse = port.deleteShipmentOrder(auth, ddRequest);

                //Response status
                Statusinformation status     = delResponse.Status;
                String            statusText = status.statusText;
                DeletionState[]   delStates  = delResponse.DeletionState;

                Console.Write("deleteShipmentOrderRequest: \n" +
                              "Status-msg: " + statusText + "\n");

                foreach (DeletionState delState in delStates)
                {
                    Console.Write("tracking number: " + delState.shipmentNumber + "\n" +
                                  "Status: " + delState.Status.statusText + "\n" +
                                  "Status-Code: " + delState.Status.statusCode + "\n");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Each key terminates the Program!");
                String wait = Console.ReadLine();
                Environment.Exit(0);
            }
        }