public TCreateProductAttribute_Return[] createProductAttribute(string ProductType, TCreateProductAttribute_Input[] ProductAttributes) { object[] results = this.Invoke("createProductAttribute", new object[] { ProductType, ProductAttributes}); return ((TCreateProductAttribute_Return[])(results[0])); }
/// <remarks/> public System.IAsyncResult BegincreateProductAttribute(string ProductType, TCreateProductAttribute_Input[] ProductAttributes, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("createProductAttribute", new object[] { ProductType, ProductAttributes}, callback, asyncState); }
/// <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"); }