Beispiel #1
0
        public string BasicWebServiceTest(string Method, string[] Parameters)
        {
            XElement conf = new XElement("Query");

            conf.Add(new XElement("ServiceURL", "http://sccm01/ConfigMgrWebService/ConfigMgr.asmx"));
            conf.Add(new XElement("Method", Method));
            conf.Add(new XAttribute("AuthID", "TestCase"));
            for (int i = 0; i < Parameters.GetLength(0); i = i + 2)
            {
                XElement x = new XElement("Parameter", Parameters[i + 1]);
                x.Add(new XAttribute("Name", Parameters[i]));
                conf.Add(x);
            }

            TestDirector director = new TestDirector();

            Director.OverrideInstance(director);
            WebServicesQuery newquery = new WebServicesQuery(conf, null);

            newquery.ProcessQuery();
            return(newquery.Response);
        }
Beispiel #2
0
        public CustomerOrderInfoDoc GetCustomerOrderInfo(
            string ChannelId,
            string LanguageId,
            string ClientIdentity,
            string OrderNumber,
            Nullable <int> OrderSequence)
        {
            CustomerOrderInfoDoc res = new CustomerOrderInfoDoc();

            try
            {
                BeginWebmethod(ChannelId);

                try
                {
                    WebServicesQuery pkg = new WebServicesQuery(GetDataBase());

                    IDataReader aCustomerOrderRdr     = null;
                    IDataReader aCustomerWorkOrderRdr = null;
                    IDataReader aDepartureRdr         = null;
                    IDataReader aOrderQuantitiesRdr   = null;
                    IDataReader aCustomerOrderRowRdr  = null;

                    pkg.GetCustomerOrderInfo(ClientIdentity,
                                             OrderNumber,
                                             OrderSequence,
                                             LanguageId,
                                             out aCustomerOrderRdr,
                                             out aCustomerWorkOrderRdr,
                                             out aDepartureRdr,
                                             out aOrderQuantitiesRdr,
                                             out aCustomerOrderRowRdr);

                    ArrayList aCustomerOrderList     = CustomerOrder.Read(aCustomerOrderRdr);
                    ArrayList aCustomerWorkOrderList = CustomerWorkOrder.Read(aCustomerWorkOrderRdr);
                    ArrayList aDepartureList         = Departure.Read(aDepartureRdr);
                    ArrayList aOrderQuantitiesList   = OrderQuantities.Read(aOrderQuantitiesRdr);
                    ArrayList aCustomerOrderRowList  = CustomerOrderRow.Read(aCustomerOrderRowRdr);

                    res.aCustomerOrderList     = aCustomerOrderList.ToArray(typeof(CustomerOrder)) as CustomerOrder[];
                    res.aCustomerWorkOrderList = aCustomerWorkOrderList.ToArray(typeof(CustomerWorkOrder)) as CustomerWorkOrder[];
                    res.aDepartureList         = aDepartureList.ToArray(typeof(Departure)) as Departure[];
                    res.aOrderQuantitiesList   = aOrderQuantitiesList.ToArray(typeof(OrderQuantities)) as OrderQuantities[];
                    res.aCustomerOrderRowList  = aCustomerOrderRowList.ToArray(typeof(CustomerOrderRow)) as CustomerOrderRow[];

                    GetDataBase().Commit();
                }
                catch (Exception e)
                {
                    try
                    {
                        GetDataBase().Rollback();
                    }
                    catch (Exception)
                    { }
                    Exception InternalError = new Exception("DataError: Error processing data", e);
                    throw (InternalError);
                }
            }

            finally
            {
                EndWebmethod();
            }

            return(res);
        }