예제 #1
0
        public void Init()
        {
            customerGroupService                 = new CustomerGroupService();
            customerGroupService.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
            customerGroupService.PreAuthenticate = true;
            customerGroupService.Url             = WEBSERVICE_URL;

            group_in.Alias = alias;
            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "TestGruppe";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "TestGroup";

            group_up.Alias = alias;
            TLocalizedValue name2_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "TestGruppe modifiziert";
            TLocalizedValue name2_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "TestGroup changed";
        }
예제 #2
0
        private ArrayList createTestProducts(string[] aliases)
        {
            List <TCreate_Input> products = new List <TCreate_Input>();

            foreach (string alias in aliases)
            {
                TCreate_Input product = new TCreate_Input();

                product.Alias      = alias;
                product.StockLevel = 1;

                TLocalizedValue name = new TLocalizedValue();
                name.LanguageCode = "de";
                name.Value        = "DotNotTestProduct " + alias;
                product.Name      = new TLocalizedValue[] { name };

                TProductPrice price = new TProductPrice();
                price.Price           = (float)123;
                price.CurrencyID      = "EUR";
                price.TaxModel        = "gross";
                product.ProductPrices = new TProductPrice[] { price };

                products.Add(product);
            }

            return(productServiceClient.create(products.ToArray()));
        }
예제 #3
0
        public void Init()
        {
            serviceClient = new CatalogServiceClient();
            full          = path + "/" + alias;

            // create test Catalogs that can be used with the create and update methods
            Catalog_in.Alias = alias;

            Catalog_in.IsVisible          = true;
            Catalog_in.IsVisibleSpecified = true;
            Catalog_in.ParentCatalog      = path;

            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "Mein Katalogname";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "My Catalog Name";
            Catalog_in.Name      = new TLocalizedValue[] { name_de, name_en };

            TAttribute attr = new TAttribute();

            attr.Name             = "Date";
            attr.Type             = "DateTime";
            attr.Value            = "2005-12-24T10:00:00";
            Catalog_in.Attributes = new TAttribute[] { attr };

            Catalog_update.Path = full;

            // IMPORTANT!!!
            // .NET has the terrible behavior, to set all boolean and numeric value that are not
            // defined to "false" resp. "0"
            // So if you update an object and do not set the "IsVisible" flag, it will set the object to
            // invisible!!!
            Catalog_update.IsVisible          = true;
            Catalog_update.IsVisibleSpecified = true;

            TLocalizedValue name_de_updated = new TLocalizedValue();

            name_de_updated.LanguageCode = "de";
            name_de_updated.Value        = "Mein geänderter Katalogname";
            TLocalizedValue name_en_updated = new TLocalizedValue();

            name_en_updated.LanguageCode = "en";
            name_en_updated.Value        = "My updated Catalog Name";
            Catalog_update.Name          = new TLocalizedValue[] { name_de_updated, name_en_updated };

            TAttribute attr_update = new TAttribute();

            attr_update.Name          = "Date";
            attr_update.Type          = "DateTime";
            attr_update.Value         = "2005-12-24T18:00:00";
            Catalog_update.Attributes = new TAttribute[] { attr_update };
        }
예제 #4
0
        /// <summary>
        /// test create
        /// </summary>
        public void testCreate()
        {
            Console.WriteLine("ProductTypeTest: testCreate start");

            TCreate_Input create1 = new TCreate_Input();

            create1.Alias = NET_TEST1_ALIAS;
            create1.LayoutContentBundles = NET_TEST1_LAYOUT_BUNDLES;
            TLocalizedValue name1_de = new TLocalizedValue();

            name1_de.LanguageCode = "de";
            name1_de.Value        = NET_TEST1_NAME_DE;
            TLocalizedValue name1_en = new TLocalizedValue();

            name1_en.LanguageCode = "en";
            name1_en.Value        = NET_TEST1_NAME_EN;
            create1.Name          = new TLocalizedValue[] { name1_de, name1_en };

            TCreate_Input create2 = new TCreate_Input();

            create2.Alias             = NET_TEST2_ALIAS;
            create2.LayoutContentBase = NET_TEST2_LAYOUT_BASE;
            TLocalizedValue name2_de = new TLocalizedValue();

            name2_de.LanguageCode = "de";
            name2_de.Value        = NET_TEST2_NAME_DE;
            TLocalizedValue name2_en = new TLocalizedValue();

            name2_en.LanguageCode = "en";
            name2_en.Value        = NET_TEST2_NAME_EN;
            create2.Name          = new TLocalizedValue[] { name2_de, name2_en };

            TCreate_Input[]  createProductTypes = new TCreate_Input[] { create1, create2 };
            TCreate_Return[] productTypes       = productTypeService.create(createProductTypes);

            Assert.AreEqual(createProductTypes.Length, productTypes.Length);

            Assert.AreEqual(NET_TEST1_ALIAS, productTypes[0].Alias);
            Assert.IsNull(productTypes[0].Error);
            Assert.IsTrue(productTypes[0].created);
            Assert.AreEqual(NET_TEST1_PATH, productTypes[0].Path);

            Assert.AreEqual(NET_TEST2_ALIAS, productTypes[1].Alias);
            Assert.IsNull(productTypes[1].Error);
            Assert.IsTrue(productTypes[1].created);
            Assert.AreEqual(NET_TEST2_PATH, productTypes[1].Path);

            Console.WriteLine("ProductTypeTest: testCreate end");
        }
예제 #5
0
        private ArrayList updateContent()
        {
            List <TUpdate_Input> updates = new List <TUpdate_Input>();
            TUpdate_Input        update  = new TUpdate_Input();

            update.Path = productPaths[0];

            TLocalizedValue name = new TLocalizedValue();

            name.LanguageCode = "de";
            name.Value        = "Updated DotNetTestProduct " + productPaths[0];
            update.Name       = new TLocalizedValue[] { name };

            updates.Add(update);

            return(productServiceClient.update(updates.ToArray()));
        }
예제 #6
0
        /// <summary>
        /// test update
        /// </summary>
        public void testUpdate()
        {
            Console.WriteLine("ProductTypeTest: testUpdate start");

            TUpdate_Input update1 = new TUpdate_Input();

            update1.Path = NET_TEST1_PATH;
            update1.LayoutContentBundles = "BundlesTable";
            TLocalizedValue name1_de = new TLocalizedValue();

            name1_de.LanguageCode = "de";
            name1_de.Value        = NET_TEST1_NAME_DE + "updated";
            update1.Name          = new TLocalizedValue[] { name1_de };

            TUpdate_Return[] productTypes = productTypeService.update(new TUpdate_Input[] { update1 });
            Assert.AreEqual(1, productTypes.Length);
            Assert.AreEqual(NET_TEST1_PATH, productTypes[0].Path);
            Assert.IsNull(productTypes[0].Error);
            Assert.IsTrue(productTypes[0].updated);

            TGetInfo_Return[] result = productTypeService.getInfo(
                new String[] { NET_TEST1_PATH },
                new String[] { },
                new String[] { "de", "en" });

            Assert.AreEqual(1, result.Length);
            Assert.AreEqual(NET_TEST1_PATH, result[0].Path);
            Assert.IsNull(result[0].Error);
            Assert.AreEqual(NET_TEST1_ALIAS, result[0].Alias);
            Assert.AreEqual("BundlesTable", result[0].LayoutContentBundles);
            TLocalizedValue[] names = result[0].Name;
            Assert.AreEqual(2, names.Length);
            Assert.AreEqual("de", names[0].LanguageCode);
            Assert.AreEqual(NET_TEST1_NAME_DE + "updated", names[0].Value);
            Assert.AreEqual("en", names[1].LanguageCode);
            Assert.AreEqual(NET_TEST1_NAME_EN, names[1].Value);

            Console.WriteLine("ProductTypeTest: testUpdate end");
        }
예제 #7
0
        /// <summary>
        /// test updateProductAttribute
        /// </summary>
        public void testUpdateProductAttribute()
        {
            Console.WriteLine("ProductTypeTest: testUpdateProductAttribute start");

            TUpdateProductAttribute_Input in1 = new TUpdateProductAttribute_Input();

            in1.Alias           = ATTRIBUTE1_ALIAS;
            in1.IsHTML          = false;
            in1.IsHTMLSpecified = true;
            in1.Position        = "1";

            TLocalizedValue descr1EN = new TLocalizedValue();

            descr1EN.LanguageCode = "en";
            descr1EN.Value        = ATTRIBUTE1_DESCR_EN + "updated";
            in1.Description       = new TLocalizedValue[] { descr1EN };

            TUpdateProductAttribute_Input in2 = new TUpdateProductAttribute_Input();

            in2.Alias              = ATTRIBUTE2_ALIAS;
            in2.IsVisible          = true;
            in2.IsVisibleSpecified = true;

            TLocalizedValue name2DE = new TLocalizedValue();

            name2DE.LanguageCode = "de";
            name2DE.Value        = ATTRIBUTE2_NAME_DE + "updated";
            in2.Name             = new TLocalizedValue[] { name2DE };

            TUpdateProductAttribute_Input in3 = new TUpdateProductAttribute_Input();

            in3.Alias = NOT_EXISTING_ALIAS;

            TUpdateProductAttribute_Return[] attributes = productTypeService.updateProductAttribute(
                NET_TEST1_PATH, new TUpdateProductAttribute_Input[] { in1, in2, in3 }
                );

            Assert.IsNotNull(attributes);
            Assert.AreEqual(3, attributes.Length);

            Assert.AreEqual(ATTRIBUTE1_ALIAS, attributes[0].Alias);
            Assert.IsNull(attributes[0].Error);
            Assert.IsTrue(attributes[0].updated);

            Assert.AreEqual(ATTRIBUTE2_ALIAS, attributes[1].Alias);
            Assert.IsNull(attributes[1].Error);
            Assert.IsTrue(attributes[1].updated);

            Assert.AreEqual(NOT_EXISTING_ALIAS, attributes[2].Alias);
            Assert.IsNotNull(attributes[2].Error);

            TGetProductAttributeInfo_Return[] attributes2 = productTypeService.getProductAttributeInfo(
                NET_TEST1_PATH,
                new String[] { ATTRIBUTE1_ALIAS, ATTRIBUTE2_ALIAS },
                new String[] { "en", "de" }
                );
            Assert.IsNotNull(attributes2);
            Assert.AreEqual(2, attributes2.Length);

            Assert.AreEqual(ATTRIBUTE1_ALIAS, attributes2[0].Alias);
            Assert.IsNull(attributes2[0].Error);
            Assert.AreEqual(ATTRIBUTE1_PATH, attributes2[0].Path);
            Assert.IsTrue(attributes2[0].IsVisible);
            Assert.IsFalse(attributes2[0].IsHTML);
            Assert.AreEqual(0, Int32.Parse(attributes2[0].Position) % 10);
            TLocalizedValue[] descriptions = attributes2[0].Description;
            Assert.AreEqual(2, descriptions.Length);
            foreach (TLocalizedValue description in descriptions)
            {
                if ("de".Equals(description.LanguageCode))
                {
                    Assert.AreEqual(ATTRIBUTE1_DESCR_DE, description.Value);
                }
                else if ("en".Equals(description.LanguageCode))
                {
                    Assert.AreEqual(ATTRIBUTE1_DESCR_EN + "updated", description.Value);
                }
            }

            Assert.AreEqual(ATTRIBUTE2_ALIAS, attributes2[1].Alias);
            Assert.IsNull(attributes2[1].Error);
            Assert.AreEqual(ATTRIBUTE2_PATH, attributes2[1].Path);
            Assert.IsTrue(attributes2[1].IsVisible);
            Assert.IsFalse(attributes2[1].IsHTML);
            Assert.AreEqual(0, Int32.Parse(attributes2[1].Position) % 10);
            TLocalizedValue[] names = attributes2[1].Name;
            Assert.AreEqual(2, names.Length);
            foreach (TLocalizedValue name in names)
            {
                if ("de".Equals(name.LanguageCode))
                {
                    Assert.AreEqual(ATTRIBUTE2_NAME_DE + "updated", name.Value);
                }
                else if ("en".Equals(name.LanguageCode))
                {
                    Assert.AreEqual(ATTRIBUTE2_NAME_EN, name.Value);
                }
            }
            Assert.IsTrue(Int32.Parse(attributes2[0].Position) < Int32.Parse(attributes2[1].Position));

            Console.WriteLine("ProductTypeTest: testUpdateProductAttribute end");
        }
예제 #8
0
        /// <summary>
        /// test createProductAttribute
        /// </summary>
        public void testCreateProductAttribute()
        {
            Console.WriteLine("ProductTypeTest: testCreateProductAttribute start");

            TCreateProductAttribute_Input in1 = new TCreateProductAttribute_Input();

            in1.Alias = ATTRIBUTE1_ALIAS;
            in1.Type  = ATTRIBUTE1_TYPE;

            TLocalizedValue Name1DE = new TLocalizedValue();

            Name1DE.LanguageCode = "de";
            Name1DE.Value        = ATTRIBUTE1_NAME_DE;
            TLocalizedValue Name1EN = new TLocalizedValue();

            Name1EN.LanguageCode = "en";
            Name1EN.Value        = ATTRIBUTE1_NAME_EN;
            in1.Name             = new TLocalizedValue[] { Name1DE, Name1EN };

            TLocalizedValue Descr1DE = new TLocalizedValue();

            Descr1DE.LanguageCode = "de";
            Descr1DE.Value        = ATTRIBUTE1_DESCR_DE;
            TLocalizedValue Descr1EN = new TLocalizedValue();

            Descr1EN.LanguageCode = "en";
            Descr1EN.Value        = ATTRIBUTE1_DESCR_EN;
            in1.Description       = new TLocalizedValue[] { Descr1DE, Descr1EN };

            in1.IsVisible          = true;
            in1.IsVisibleSpecified = true;
            in1.IsHTML             = true;
            in1.IsHTMLSpecified    = true;
            in1.Position           = "8192";

            TCreateProductAttribute_Input in2 = new TCreateProductAttribute_Input();

            in2.Alias = ATTRIBUTE2_ALIAS;
            in2.Type  = ATTRIBUTE2_TYPE;

            TLocalizedValue Name2DE = new TLocalizedValue();

            Name2DE.LanguageCode = "de";
            Name2DE.Value        = ATTRIBUTE2_NAME_DE;
            TLocalizedValue Name2EN = new TLocalizedValue();

            Name2EN.LanguageCode = "en";
            Name2EN.Value        = ATTRIBUTE2_NAME_EN;
            in2.Name             = new TLocalizedValue[] { Name2DE, Name2EN };

            TLocalizedValue Descr2DE = new TLocalizedValue();

            Descr2DE.LanguageCode = "de";
            Descr2DE.Value        = ATTRIBUTE2_DESCR_DE;
            TLocalizedValue Descr2EN = new TLocalizedValue();

            Descr2EN.LanguageCode = "en";
            Descr2EN.Value        = ATTRIBUTE2_DESCR_EN;
            in2.Description       = new TLocalizedValue[] { Descr2DE, Descr2EN };

            in2.Position = "4096";

            TCreateProductAttribute_Input in3 = new TCreateProductAttribute_Input();

            in3.Alias = "CurrencyID"; // reserved attribute alias
            in3.Type  = ATTRIBUTE1_TYPE;

            TCreateProductAttribute_Input[]  input      = { in1, in2, in3 };
            TCreateProductAttribute_Return[] attributes = productTypeService.createProductAttribute(
                NET_TEST1_PATH, input
                );
            Assert.IsNotNull(attributes);
            Assert.AreEqual(input.Length, attributes.Length);
            Assert.AreEqual(ATTRIBUTE1_ALIAS, attributes[0].Alias);
            Assert.IsNull(attributes[0].Error);
            Assert.AreEqual(ATTRIBUTE1_PATH, attributes[0].Path);
            Assert.IsTrue(attributes[0].created);
            Assert.AreEqual(ATTRIBUTE2_ALIAS, attributes[1].Alias);
            Assert.IsNull(attributes[1].Error);
            Assert.AreEqual(ATTRIBUTE2_PATH, attributes[1].Path);
            Assert.IsTrue(attributes[1].created);
            Assert.AreEqual("CurrencyID", attributes[2].Alias);
            Assert.IsNotNull(attributes[2].Error);

            Console.WriteLine("ProductTypeTest: testCreateProductAttribute end");
        }
예제 #9
0
        public void Init()
        {
            serviceClient = new ProductServiceClient();

            // create test Products that can be used with the create and update methods
            Product_in.Alias = alias;
            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "Test-Hauptprodukt";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "test master product";
            Product_in.Name      = new TLocalizedValue[] { name_de, name_en };

            Product_in.Class         = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_in.TaxClass      = "/TaxMatrixGermany/normal";
            Product_in.IsVisible     = true;         Product_in.IsVisibleSpecified = true;
            Product_in.IsNew         = true;         Product_in.IsNewSpecified = true;
            Product_in.PriceQuantity = (float)1;     Product_in.PriceQuantitySpecified = true;
            Product_in.MinOrder      = (float)1;     Product_in.MinOrderSpecified = true;
            Product_in.IntervalOrder = (float)1;     Product_in.IntervalOrderSpecified = true;
            Product_in.OrderUnit     = "/Units/piece";

            Product_in.Weight     = (float)240;   Product_in.WeightSpecified = true;
            Product_in.WeightUnit = "/Units/gram";

            Product_in.RefAmount        = (float)1;     Product_in.RefAmountSpecified = true;
            Product_in.RefContentAmount = (float)0.240; Product_in.RefContentAmountSpecified = true;
            Product_in.RefUnit          = "Units/gram/kilogram";

            Product_in.StockLevel      = (float)140;   Product_in.StockLevelSpecified = true;
            Product_in.StockLevelAlert = (float)100;   Product_in.StockLevelAlertSpecified = true;

            TProductPrice price = new TProductPrice();

            price.Price              = (float)123;
            price.CurrencyID         = "EUR";
            price.TaxModel           = "gross";
            Product_in.ProductPrices = new TProductPrice[] { price };

            TAttribute attr = new TAttribute();

            attr.Name             = "AvailabilityDate";
            attr.Type             = "DateTime";
            attr.Value            = "2005-12-24T10:00:00";
            Product_in.Attributes = new TAttribute[] { attr };


            Product_update.Path = path + alias;
            TLocalizedValue name_de_update = new TLocalizedValue();

            name_de_update.LanguageCode = "de";
            name_de_update.Value        = "verändertes Test-Hauptprodukt";
            TLocalizedValue name_en_update = new TLocalizedValue();

            name_en_update.LanguageCode = "en";
            name_en_update.Value        = "updated test master product";
            Product_update.Name         = new TLocalizedValue[] { name_de_update, name_en_update };

            Product_update.IsVisible     = true;         Product_update.IsVisibleSpecified = true;
            Product_update.IsNew         = true;         Product_update.IsNewSpecified = true;
            Product_update.PriceQuantity = (float)1;     Product_update.PriceQuantitySpecified = true;
            Product_update.MinOrder      = (float)1;     Product_update.MinOrderSpecified = true;
            Product_update.IntervalOrder = (float)1;     Product_update.IntervalOrderSpecified = true;

            Product_update.Weight           = (float)240;   Product_update.WeightSpecified = true;
            Product_update.RefAmount        = (float)1;     Product_update.RefAmountSpecified = true;
            Product_update.RefContentAmount = (float)0.240; Product_update.RefContentAmountSpecified = true;

            Product_update.StockLevel      = (float)140;   Product_update.StockLevelSpecified = true;
            Product_update.StockLevelAlert = (float)100;   Product_update.StockLevelAlertSpecified = true;

            TProductPrice price_update = new TProductPrice();

            price_update.Price           = (float)123.50;
            price_update.CurrencyID      = "EUR";
            price_update.TaxModel        = "gross";
            Product_update.ProductPrices = new TProductPrice[] { price_update };

            TAttribute attr_update = new TAttribute();

            attr_update.Name          = "AvailabilityDate";
            attr_update.Type          = "DateTime";
            attr_update.Value         = "2005-12-24T18:00:00";
            Product_update.Attributes = new TAttribute[] { attr_update };
        }
예제 #10
0
        public void Init()
        {
            serviceClient = new ProductService5Client();

            // create test Products that can be used with the create and update methods
            Product_in.Alias = alias;
            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "Test-Hauptprodukt";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "test master product";
            Product_in.Name      = new TLocalizedValue[] { name_de, name_en };

            Product_in.Class         = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_in.TaxClass      = "/TaxMatrixGermany/normal";
            Product_in.IsVisible     = true;         Product_in.IsVisibleSpecified = true;
            Product_in.IsNew         = true;         Product_in.IsNewSpecified = true;
            Product_in.PriceQuantity = (float)1;     Product_in.PriceQuantitySpecified = true;
            Product_in.MinOrder      = (float)1;     Product_in.MinOrderSpecified = true;
            Product_in.IntervalOrder = (float)1;     Product_in.IntervalOrderSpecified = true;
            Product_in.OrderUnit     = "/Units/piece";

            Product_in.Weight     = (float)240;   Product_in.WeightSpecified = true;
            Product_in.WeightUnit = "/Units/gram";

            Product_in.RefAmount        = (float)1;     Product_in.RefAmountSpecified = true;
            Product_in.RefContentAmount = (float)0.240; Product_in.RefContentAmountSpecified = true;
            Product_in.RefUnit          = "Units/gram/kilogram";

            Product_in.StockLevel      = (float)140;   Product_in.StockLevelSpecified = true;
            Product_in.StockLevelAlert = (float)100;   Product_in.StockLevelAlertSpecified = true;

            Product_in.DeliveryPeriod = "asap";

            Product_in.AvailabilityDate = new DateTime(2005, 12, 24, 10, 0, 0);

            TProductPrice price = new TProductPrice();

            price.Price              = (float)123;
            price.CurrencyID         = "EUR";
            price.TaxModel           = "gross";
            Product_in.ProductPrices = new TProductPrice[] { price };

            Product_update.Path = path + alias;
            TLocalizedValue name_de_update = new TLocalizedValue();

            name_de_update.LanguageCode = "de";
            name_de_update.Value        = "verändertes Test-Hauptprodukt";
            TLocalizedValue name_en_update = new TLocalizedValue();

            name_en_update.LanguageCode = "en";
            name_en_update.Value        = "updated test master product";
            Product_update.Name         = new TLocalizedValue[] { name_de_update, name_en_update };

            Product_update.IsVisible     = true;         Product_update.IsVisibleSpecified = true;
            Product_update.IsNew         = true;         Product_update.IsNewSpecified = true;
            Product_update.PriceQuantity = (float)1;     Product_update.PriceQuantitySpecified = true;
            Product_update.MinOrder      = (float)1;     Product_update.MinOrderSpecified = true;
            Product_update.IntervalOrder = (float)1;     Product_update.IntervalOrderSpecified = true;

            Product_update.Weight           = (float)240;   Product_update.WeightSpecified = true;
            Product_update.RefAmount        = (float)1;     Product_update.RefAmountSpecified = true;
            Product_update.RefContentAmount = (float)0.240; Product_update.RefContentAmountSpecified = true;

            Product_update.StockLevel      = (float)140;   Product_update.StockLevelSpecified = true;
            Product_update.StockLevelAlert = (float)100;   Product_update.StockLevelAlertSpecified = true;

            Product_update.DeliveryPeriod = "as soon as possible";

            TProductPrice price_update = new TProductPrice();

            price_update.Price           = (float)123.50;
            price_update.CurrencyID      = "EUR";
            price_update.TaxModel        = "gross";
            Product_update.ProductPrices = new TProductPrice[] { price_update };



            // create test Products that can be used as download product
            Product_down.Alias = alias;
            TLocalizedValue name_de_down = new TLocalizedValue();

            name_de_down.LanguageCode = "de";
            name_de_down.Value        = "Test-Downloadprodukt";
            TLocalizedValue name_en_down = new TLocalizedValue();

            name_en_down.LanguageCode = "en";
            name_en_down.Value        = "test master product";
            Product_down.Name         = new TLocalizedValue[] { name_de, name_en };

            Product_down.Class             = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_down.TaxClass          = "/TaxMatrixGermany/normal";
            Product_down.IsAvailable       = true; Product_in.IsAvailableSpecified = true;
            Product_down.IsDownloadProduct = true;
            Product_down.MaxDownloadTime   = "5";
            Product_down.MaxDownloadCount  = "3";

            TDownload download = new TDownload();

            download.IsExternal = true;
            download.FileName   = "http://www.epages.com/de/download/de-epages6-SEO.pdf";
            download.Position   = "10";
            Product_down.DownloadProductMaps = new TDownload[] { download };
        }
예제 #11
0
        public void Init()
        {
            Console.WriteLine("CrossSellingTest: Init");

            TLocalizedValue comment1_de = new TLocalizedValue();

            comment1_de.LanguageCode = "de";
            comment1_de.Value        = ".net CrossSellingService Test";
            TLocalizedValue comment1_en = new TLocalizedValue();

            comment1_en.LanguageCode = "en";
            comment1_en.Value        = ".net CrossSellingService Test";
            Comment1 = new TLocalizedValue[] { comment1_de, comment1_en };

            TLocalizedValue comment2_de = new TLocalizedValue();

            comment2_de.LanguageCode = "de";
            comment2_de.Value        = ".net CrossSellingService Test Aktualisierung";
            TLocalizedValue comment2_en = new TLocalizedValue();

            comment2_en.LanguageCode = "en";
            comment2_en.Value        = ".net CrossSellingService test update";
            Comment2 = new TLocalizedValue[] { comment2_de, comment2_en };

            crossSellingService                 = new CrossSellingService();
            crossSellingService.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
            crossSellingService.PreAuthenticate = true;
            crossSellingService.Url             = WEBSERVICE_URL;

            // remove all assigned cross selling products
            TDelete_Input CrossSelling_in = new TDelete_Input();

            CrossSelling_in.Product       = product;
            CrossSelling_in.TargetProduct = "*";
            CrossSelling_in.Type          = "CrossSelling";
            TDelete_Input[]  CrossSellings     = new TDelete_Input[] { CrossSelling_in };
            TDelete_Return[] CrossSellings_out = crossSellingService.delete(CrossSellings);

            Console.WriteLine("delete all CrossSelling: " + CrossSellings_out.GetLength(0));
            foreach (TDelete_Return result in CrossSellings_out)
            {
                if (result.Error != null)
                {
                    Console.Error.WriteLine("delete CrossSelling failed:" + result.Error.Message);
                }
                else
                {
                    Console.WriteLine("deleted CrossSelling: " + result.TargetProduct + " : " + result.deleted);
                }
            }

            CrossSelling_in               = new TDelete_Input();
            CrossSelling_in.Product       = product;
            CrossSelling_in.TargetProduct = "*";
            CrossSelling_in.Type          = "Accessory";
            CrossSellings     = new TDelete_Input[] { CrossSelling_in };
            CrossSellings_out = crossSellingService.delete(CrossSellings);

            Console.WriteLine("delete all Accessory: " + CrossSellings_out.GetLength(0));
            foreach (TDelete_Return result in CrossSellings_out)
            {
                if (result.Error != null)
                {
                    Console.Error.WriteLine("delete failed:" + result.Error.Message);
                }
                else
                {
                    Console.WriteLine("deleted Accessory: " + result.TargetProduct + " : " + result.deleted);
                }
            }

            CrossSelling_in               = new TDelete_Input();
            CrossSelling_in.Product       = product;
            CrossSelling_in.TargetProduct = "*";
            CrossSelling_in.Type          = "ProductComparison";
            CrossSellings     = new TDelete_Input[] { CrossSelling_in };
            CrossSellings_out = crossSellingService.delete(CrossSellings);

            Console.WriteLine("delete all ProductComparison: " + CrossSellings_out.GetLength(0));
            foreach (TDelete_Return result in CrossSellings_out)
            {
                if (result.Error != null)
                {
                    Console.Error.WriteLine("delete ProductComparison failed:" + result.Error.Message);
                }
                else
                {
                    Console.WriteLine("deleted ProductComparison: " + result.TargetProduct + " : " + result.deleted);
                }
            }
        }
예제 #12
0
        public void Init()
        {
            Console.WriteLine("Catalog3Test: Init");

            catalogService                 = new CatalogService();
            catalogService.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
            catalogService.PreAuthenticate = true;
            catalogService.Url             = WEBSERVICE_URL;

            // init paths
            sort3 = path + "/Tents";
            sort2 = sort3 + "/FamilyTents";
            sort1 = sort3 + "/IndividualTents";
            full  = path + "/" + alias;

            // init test Catalogs that can be used with the create methods
            Catalog_in.Alias = alias;

            TLocalizedValue Catalog_in_Name_de = new TLocalizedValue();

            Catalog_in_Name_de.LanguageCode = "de";
            Catalog_in_Name_de.Value        = "Test-Katalog";
            TLocalizedValue Catalog_in_Name_en = new TLocalizedValue();

            Catalog_in_Name_en.LanguageCode = "en";
            Catalog_in_Name_en.Value        = "test Catalog";
            Catalog_in.Name = (new TLocalizedValue[] { Catalog_in_Name_de, Catalog_in_Name_en });

            Catalog_in.IsVisible          = true;
            Catalog_in.IsVisibleSpecified = true;
            Catalog_in.ParentCatalog      = path;

            TAttribute attr = new TAttribute();

            attr.Name             = "Date";
            attr.Type             = "DateTime";
            attr.Value            = "2005-12-24T10:00:00";
            Catalog_in.Attributes = new TAttribute[] { attr };

            TAttribute layout1 = new TAttribute();

            layout1.Name  = "Content-Order";
            layout1.Value = "Base_Products_Pages";
            TAttribute layout2 = new TAttribute();

            layout2.Name             = "Content-Pages";
            layout2.Value            = "Pages_SingleColumn";
            Catalog_in.TemplateTypes = new TAttribute[] { layout1, layout2 };


            // init test Catalogs that can be used with the create methods
            Catalog_up.Path = full;

            TLocalizedValue Catalog_up_Name_de = new TLocalizedValue();

            Catalog_up_Name_de.LanguageCode = "de";
            Catalog_up_Name_de.Value        = "anderer Test-Katalog";
            TLocalizedValue Catalog_up_Name_en = new TLocalizedValue();

            Catalog_up_Name_en.LanguageCode = "en";
            Catalog_up_Name_en.Value        = "updated test Catalog";
            Catalog_up.Name = (new TLocalizedValue[] { Catalog_up_Name_de, Catalog_up_Name_en });

            Catalog_up.IsVisible          = false;
            Catalog_up.IsVisibleSpecified = true;

            TAttribute attr_up = new TAttribute();

            attr_up.Name          = "Date";
            attr_up.Type          = "DateTime";
            attr_up.Value         = "2005-12-24T18:00:00";
            Catalog_up.Attributes = new TAttribute[] { attr_up };

            TAttribute layout3 = new TAttribute();

            layout3.Name  = "Content-Order";
            layout3.Value = "Pages_Products_Base";
            TAttribute layout4 = new TAttribute();

            layout4.Name             = "Content-Pages";
            layout4.Value            = "Pages_TwoColumns";
            Catalog_in.TemplateTypes = new TAttribute[] { layout3, layout4 };


            // init parameters for sort methods
            Catalog_sort1.Path   = sort1;
            Catalog_sort2.Path   = sort2;
            Catalog_sort2.sort   = "byPriceDESC";
            Catalog_sort3.Path   = sort3;
            Catalog_sort3.sort   = "byPriceASC";
            Catalog_sort3.allSub = true;

            // delete test catalog if exists
            TExists_Return[] Catalogs_out = catalogService.exists(new string[] { full });
            if (Catalogs_out[0].exists)
            {
                catalogService.delete(new string[] { full });
            }
        }
예제 #13
0
        public void Init()
        {
            // try to get customer groups at first, because they are different since patch 7
            string customerGroupsPath = "/Shops/DemoShop/Groups/";

            string[] customerGroups = new string[] {
                customerGroupsPath + "NewCustomer",
                customerGroupsPath + "RegularCustomer"
            };

            WebServiceConfiguration WSConfig = new WebServiceConfiguration();

            CustomerGroupService custService = new CustomerGroupService();

            custService.Credentials     = new System.Net.NetworkCredential(WebServiceConfiguration.WEBSERVICE_LOGIN, WebServiceConfiguration.WEBSERVICE_PASSWORD);
            custService.PreAuthenticate = true;
            custService.Url             = WSConfig.WEBSERVICE_URL;
            TGetList_Return[] retGroups = custService.getList();
            customerGroups[0] = customerGroupsPath + retGroups[0].Alias;
            customerGroups[1] = customerGroupsPath + retGroups[1].Alias;

            serviceClient = new PriceListServiceClient();

            // create test PriceLists that can be used with the create and update methods
            PriceList_in.Alias          = alias;
            PriceList_in.CurrencyID     = "EUR";
            PriceList_in.CustomerGroups = new string[] { customerGroups[0] };
            PriceList_in.Customers      = new string[] { "/Shops/DemoShop/Customers/1001" };

            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "Meine Preisliste";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "my price list";
            PriceList_in.Name    = new TLocalizedValue[] { name_de, name_en };

            PriceList_in.TaxModel  = "gross";
            PriceList_in.ValidFrom = new DateTime(2005, 12, 1, 0, 0, 0, DateTimeKind.Local);
            PriceList_in.ValidTo   = new DateTime(2005, 12, 31, 0, 0, 0, DateTimeKind.Local);

            TAttribute attr = new TAttribute();

            attr.Name  = "CreationDate";
            attr.Type  = "DateTime";
            attr.Value = "2006-01-01T00:00:00";
            PriceList_in.Attributes = new TAttribute[] { attr };

            PriceList_update.Path = path + alias;

            TLocalizedValue name_de_update = new TLocalizedValue();

            name_de_update.LanguageCode = "de";
            name_de_update.Value        = "Meine geänderte Preisliste";
            TLocalizedValue name_en_update = new TLocalizedValue();

            name_en_update.LanguageCode = "en";
            name_en_update.Value        = "my updated price list";
            PriceList_update.Name       = new TLocalizedValue[] { name_de_update, name_en_update };

            // IMPORTANT!!!
            // .NET has the terrible behavior, to set all boolean and numeric value (incl. dates) that are not
            // defined to "false" resp. "0"
            // So if you update an object and do not set the "IsVisible" flag, it will set the object to
            // invisible!!!

            PriceList_update.ValidFrom = new DateTime(2005, 12, 1, 0, 0, 0, DateTimeKind.Local);
            PriceList_update.ValidTo   = new DateTime(2005, 12, 31, 0, 0, 0, DateTimeKind.Local);

            TAttribute attr_update = new TAttribute();

            attr_update.Name            = "CreationDate";
            attr_update.Type            = "DateTime";
            attr_update.Value           = "2006-01-01T11:11:11";
            PriceList_update.Attributes = new TAttribute[] { attr_update };
        }
예제 #14
0
        public void Init()
        {
            serviceClient = new ProductService8Client();

            // create test Products that can be used with the create and update methods
            Product_in.Alias = alias;
            TLocalizedValue name_de = new TLocalizedValue();

            name_de.LanguageCode = "de";
            name_de.Value        = "Test-Hauptprodukt";
            TLocalizedValue name_en = new TLocalizedValue();

            name_en.LanguageCode = "en";
            name_en.Value        = "test master product";
            Product_in.Name      = new TLocalizedValue[] { name_de, name_en };

            TLocalizedValue longdesc_de = new TLocalizedValue();

            longdesc_de.LanguageCode = "de";
            longdesc_de.Value        = "Test-Hauptprodukt lange Beschreibung";
            TLocalizedValue longdesc_en = new TLocalizedValue();

            longdesc_en.LanguageCode = "en";
            longdesc_en.Value        = "test master product long description";
            Product_in.Text          = new TLocalizedValue[] { longdesc_de, longdesc_en };

            TLocalizedValue title_de = new TLocalizedValue();

            title_de.LanguageCode = "de";
            title_de.Value        = "Seitentitel";
            TLocalizedValue title_en = new TLocalizedValue();

            title_en.LanguageCode = "en";
            title_en.Value        = "page title";
            Product_in.Title      = new TLocalizedValue[] { title_de, title_en };

            Product_in.Class         = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_in.TaxClass      = "/TaxMatrixGermany/normal";
            Product_in.IsVisible     = true;         Product_in.IsVisibleSpecified = true;
            Product_in.IsNew         = true;         Product_in.IsNewSpecified = true;
            Product_in.PriceQuantity = (float)1;     Product_in.PriceQuantitySpecified = true;
            Product_in.MinOrder      = (float)1;     Product_in.MinOrderSpecified = true;
            Product_in.IntervalOrder = (float)1;     Product_in.IntervalOrderSpecified = true;
            Product_in.OrderUnit     = "/Units/piece";

            Product_in.Weight     = (float)240;   Product_in.WeightSpecified = true;
            Product_in.WeightUnit = "/Units/gram";

            Product_in.RefAmount        = (float)1;     Product_in.RefAmountSpecified = true;
            Product_in.RefContentAmount = (float)0.240; Product_in.RefContentAmountSpecified = true;
            Product_in.RefUnit          = "Units/gram/kilogram";

            Product_in.StockLevel      = (float)140;   Product_in.StockLevelSpecified = true;
            Product_in.StockLevelAlert = (float)100;   Product_in.StockLevelAlertSpecified = true;

            Product_in.DeliveryPeriod = "asap";

            Product_in.AvailabilityDate = new DateTime(2005, 12, 24, 10, 0, 0);

            TProductPrice price = new TProductPrice();

            price.Price              = (float)123;
            price.CurrencyID         = "EUR";
            price.TaxModel           = "gross";
            Product_in.ProductPrices = new TProductPrice[] { price };

            TProductPrice manufacturer_price = new TProductPrice();

            manufacturer_price.Price      = (float)150;
            manufacturer_price.CurrencyID = "EUR";
            manufacturer_price.TaxModel   = "gross";
            Product_in.ManufacturerPrices = new TProductPrice[] { manufacturer_price };

            TProductPrice deposit_price = new TProductPrice();

            deposit_price.Price      = (float)5;
            deposit_price.CurrencyID = "EUR";
            deposit_price.TaxModel   = "gross";
            Product_in.DepositPrices = new TProductPrice[] { deposit_price };

            TProductPrice prepay_price = new TProductPrice();

            prepay_price.Price          = (float)10;
            prepay_price.CurrencyID     = "EUR";
            prepay_price.TaxModel       = "gross";
            Product_in.PrepaymentPrices = new TProductPrice[] { prepay_price };

            TProductPrice eco_price = new TProductPrice();

            eco_price.Price      = (float)7;
            eco_price.CurrencyID = "EUR";
            eco_price.TaxModel   = "gross";
            Product_in.EcoParticipationPrices = new TProductPrice[] { eco_price };

            TShippingMethod shipping1 = new TShippingMethod();

            shipping1.Path = "ShippingMethods/Post";
            TShippingMethod shipping2 = new TShippingMethod();

            shipping2.Path             = "ShippingMethods/Express";
            Product_in.ShippingMethods = new TShippingMethod[] { shipping1, shipping2 };

            Product_update.Path = path + alias;
            TLocalizedValue name_de_update = new TLocalizedValue();

            name_de_update.LanguageCode = "de";
            name_de_update.Value        = "verändertes Test-Hauptprodukt";
            TLocalizedValue name_en_update = new TLocalizedValue();

            name_en_update.LanguageCode = "en";
            name_en_update.Value        = "updated test master product";
            Product_update.Name         = new TLocalizedValue[] { name_de_update, name_en_update };

            TLocalizedValue longdesc_de_update = new TLocalizedValue();

            longdesc_de_update.LanguageCode = "de";
            longdesc_de_update.Value        = "Test-Hauptprodukt lange Beschreibung modifiziert";
            TLocalizedValue longdesc_en_update = new TLocalizedValue();

            longdesc_en_update.LanguageCode = "en";
            longdesc_en_update.Value        = "test master product long description updated";
            Product_update.Text             = new TLocalizedValue[] { longdesc_de_update, longdesc_en_update };

            TLocalizedValue title_de_update = new TLocalizedValue();

            title_de_update.LanguageCode = "de";
            title_de_update.Value        = "Seitentitel modifiziert";
            TLocalizedValue title_en_update = new TLocalizedValue();

            title_en_update.LanguageCode = "en";
            title_en_update.Value        = "page title modified";
            Product_update.Title         = new TLocalizedValue[] { title_de_update, title_en_update };

            Product_update.IsVisible     = true; Product_update.IsVisibleSpecified = true;
            Product_update.IsNew         = true;         Product_update.IsNewSpecified = true;
            Product_update.PriceQuantity = (float)1;     Product_update.PriceQuantitySpecified = true;
            Product_update.MinOrder      = (float)1;     Product_update.MinOrderSpecified = true;
            Product_update.IntervalOrder = (float)1;     Product_update.IntervalOrderSpecified = true;

            Product_update.Weight           = (float)240;   Product_update.WeightSpecified = true;
            Product_update.RefAmount        = (float)1;     Product_update.RefAmountSpecified = true;
            Product_update.RefContentAmount = (float)0.240; Product_update.RefContentAmountSpecified = true;

            Product_update.StockLevel      = (float)140;   Product_update.StockLevelSpecified = true;
            Product_update.StockLevelAlert = (float)100;   Product_update.StockLevelAlertSpecified = true;

            Product_update.DeliveryPeriod = "as soon as possible";

            TProductPrice price_update = new TProductPrice();

            price_update.Price           = (float)123.50;
            price_update.CurrencyID      = "EUR";
            price_update.TaxModel        = "gross";
            Product_update.ProductPrices = new TProductPrice[] { price_update };

            TProductPrice manufacturer_price_update = new TProductPrice();

            manufacturer_price_update.Price      = (float)150.50;
            manufacturer_price_update.CurrencyID = "EUR";
            manufacturer_price_update.TaxModel   = "gross";
            Product_update.ManufacturerPrices    = new TProductPrice[] { manufacturer_price_update };

            TProductPrice deposit_price_update = new TProductPrice();

            deposit_price_update.Price      = (float)5.50;
            deposit_price_update.CurrencyID = "EUR";
            deposit_price_update.TaxModel   = "gross";
            Product_update.DepositPrices    = new TProductPrice[] { deposit_price_update };

            TProductPrice prepay_price_update = new TProductPrice();

            prepay_price_update.Price       = (float)10.50;
            prepay_price_update.CurrencyID  = "EUR";
            prepay_price_update.TaxModel    = "gross";
            Product_update.PrepaymentPrices = new TProductPrice[] { prepay_price_update };

            TProductPrice eco_price_update = new TProductPrice();

            eco_price_update.Price                = (float)7.50;
            eco_price_update.CurrencyID           = "EUR";
            eco_price_update.TaxModel             = "gross";
            Product_update.EcoParticipationPrices = new TProductPrice[] { eco_price_update };

            TShippingMethod shipping3 = new TShippingMethod();

            shipping3.Path = "ShippingMethods/PickupByCustomer";
            TShippingMethod shipping4 = new TShippingMethod();

            shipping4.Path   = "ShippingMethods/Express";
            shipping4.delete = true; shipping4.deleteSpecified = true;
            Product_update.ShippingMethods = new TShippingMethod[] { shipping3, shipping4 };



            // create test Products that can be used as download product
            Product_down.Alias = alias;
            TLocalizedValue name_de_down = new TLocalizedValue();

            name_de_down.LanguageCode = "de";
            name_de_down.Value        = "Test-Downloadprodukt";
            TLocalizedValue name_en_down = new TLocalizedValue();

            name_en_down.LanguageCode = "en";
            name_en_down.Value        = "test master product";
            Product_down.Name         = new TLocalizedValue[] { name_de, name_en };

            Product_down.Class             = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_down.TaxClass          = "/TaxMatrixGermany/normal";
            Product_down.IsAvailable       = true; Product_in.IsAvailableSpecified = true;
            Product_down.IsDownloadProduct = true;
            Product_down.MaxDownloadTime   = "5";
            Product_down.MaxDownloadCount  = "3";

            TDownload download = new TDownload();

            download.IsExternal = true;
            download.FileName   = "http://www.epages.com/de/download/de-epages6-SEO.pdf";
            download.Position   = "10";
            Product_down.DownloadProductMaps = new TDownload[] { download };
        }