/// <summary>
		/// use stub to create a OrderDocument via web services
		/// </summary>
		/// <param name="OrderDocuments">Array of TCreate_Input</param>
		/// <returns>ArrayList of TCreate_Return</returns>
		public ArrayList create(TCreate_Input[] OrderDocuments)
		{
			TCreate_Return[] OrderDocuments_out = stub.create(OrderDocuments);

			ArrayList result = new ArrayList();

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

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

			return result;
		}
Exemplo n.º 2
0
		/// <summary>
		/// test creation of a OrderDocument and check if method returns a true value
		/// </summary>
		public void create()
		{
			TCreate_Input[] OrderDocuments = new TCreate_Input[]{
																	invoice_in,
																	packingslip_in,
																	creditnote_in
																};

			ArrayList OrderDocuments_out = serviceClient.create(OrderDocuments);

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

			TCreate_Return invoice_out = (TCreate_Return)OrderDocuments_out.ToArray()[0];
			Assert.AreEqual(order, invoice_out.Order, "Order path");
			Assert.AreEqual(true, invoice_out.created, "invoice created?");

			TCreate_Return packingslip_out = (TCreate_Return)OrderDocuments_out.ToArray()[1];
			Assert.AreEqual(order, packingslip_out.Order, "Order path");
			Assert.AreEqual(true, packingslip_out.created, "packingslip created?");

			TCreate_Return creditnote_out = (TCreate_Return)OrderDocuments_out.ToArray()[2];
			Assert.AreEqual(order, creditnote_out.Order, "Order path");
			Assert.AreEqual(true, creditnote_out.created, "creditnote created?");
		}
Exemplo n.º 3
0
 /// <remarks/>
 public System.IAsyncResult Begincreate(TCreate_Input[] OrderDocuments, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("create", new object[] {
                 OrderDocuments}, callback, asyncState);
 }
Exemplo n.º 4
0
 public TCreate_Return[] create(TCreate_Input[] OrderDocuments) {
     object[] results = this.Invoke("create", new object[] {
                 OrderDocuments});
     return ((TCreate_Return[])(results[0]));
 }