Ejemplo n.º 1
0
		public void Init()
		{
			// set up the ProductImageService
			productImageService = new ProductImageService();
			productImageService.Credentials = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
			productImageService.PreAuthenticate = true;
			productImageService.Url = WEBSERVICE_URL;

			// set up the ProductService in order to create a test product
			productService = new ProductService();
			productService.Credentials = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
			productService.PreAuthenticate = true;
			productService.Url = WEBSERVICE_URL;

			// create the test product
			TCreate_Input productInfo = new TCreate_Input();
			productInfo.Alias = alias;
			TCreate_Input[] createInput = new TCreate_Input[]{productInfo};
			productService.create( createInput );
		}
Ejemplo n.º 2
0
		/// <summary>
		/// use stub to create a Product via web services
		/// </summary>
		/// <param name="Products">Array of TCreate_Input</param>
		/// <returns>ArrayList of TCreate_Return</returns>
		public ArrayList create(TCreate_Input[] Products) 
		{
			TCreate_Return[] Products_out = stub.create(Products);

			ArrayList result = new ArrayList();

			for(int i = 0; i < Products_out.Length; i++)
			{
				TCreate_Return Product_out = Products_out[i];

				if (Product_out.Error == null) 
				{
					Console.WriteLine("successfully created Product: " + Product_out.Path);
					result.Add(Product_out);
				} 
				else 
				{
					Console.WriteLine("an error occured (Epages Error):\n" + Product_out.Error.Message);
				}
			}

			return result;
		}
Ejemplo n.º 3
0
 /// <remarks/>
 public System.IAsyncResult Begincreate(TCreate_Input[] Products, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("create", new object[] {
                 Products}, callback, asyncState);
 }
Ejemplo n.º 4
0
 public TCreate_Return[] create(TCreate_Input[] Products) {
     object[] results = this.Invoke("create", new object[] {
                 Products});
     return ((TCreate_Return[])(results[0]));
 }
Ejemplo n.º 5
0
		/// <summary>
		/// test creation of a Product and check if method returns a true value
		/// </summary>
		public void create()
		{
			TCreate_Input[] Products = new TCreate_Input[]{Product_in};

			ArrayList Products_out = serviceClient.create(Products);

			// test if creation was successful
			Assert.AreEqual(1, Products_out.Count, "create result set");

			TCreate_Return Product_out = (TCreate_Return)Products_out.ToArray()[0];
			Assert.AreEqual(alias, Product_out.Alias, "product alias");
			Assert.AreEqual(true, Product_out.created, "created?");
		}