Поскольку даты и я могу перемещать десятичные дроби в веб-службу в Ax, название службы, которую я использую, - CustFreeTextInvoice.
Передача строковых данных не проблема, но с датой и самими десятичными данными.
код прикреплен ...
private void btnIngresar_Click(object sender, EventArgs e)
{
FreeTextInvoiceServiceClient service = new FreeTextInvoiceServiceClient();
if (null == service)
{
throw new Exception("Cannot instantiate service.");
}
AxdFreeTextInvoice FreeTextInvoice = new AxdFreeTextInvoice();
//Record
AxdEntity_CustInvoiceTable CustInvoiceTable = new AxdEntity_CustInvoiceTable();
CustInvoiceTable.InvoiceId = "100";
CustInvoiceTable.Name = txtName.Text;
CustInvoiceTable.OneTimeCustomer = 0;
CustInvoiceTable.OrderAccount = txtOrderAccount.Text;
//CustInvoiceTable.DocumentDate = DateTime.Now;
//CustInvoiceTable.DueDate = Convert.ToDateTime("20/12/2011");
CustInvoiceTable.InvoiceDate = Convert.ToDateTime("20/11/2011");
CustInvoiceTable.CustInvoiceLine = new AxdEntity_CustInvoiceLine[2];
CustInvoiceTable.CustInvoiceLine[0] = new AxdEntity_CustInvoiceLine();
CustInvoiceTable.CustInvoiceLine[0].Description = "Primer registro";
CustInvoiceTable.CustInvoiceLine[0].LedgerAccount = "610208";
CustInvoiceTable.CustInvoiceLine[0].TaxGroup = "IVAVTAS12";
CustInvoiceTable.CustInvoiceLine[0].TaxItemGroup = "all";
CustInvoiceTable.CustInvoiceLine[0].AmountCur = 1000;
CustInvoiceTable.CustInvoiceLine[1] = new AxdEntity_CustInvoiceLine();
CustInvoiceTable.CustInvoiceLine[1].Description = "segundo registro";
CustInvoiceTable.CustInvoiceLine[1].LedgerAccount = "610208";
CustInvoiceTable.CustInvoiceLine[1].TaxGroup = "IVAVTAS12";
CustInvoiceTable.CustInvoiceLine[1].TaxItemGroup = "all";
CustInvoiceTable.CustInvoiceLine[1].AmountCur = 90;
FreeTextInvoice.CustInvoiceTable = new AxdEntity_CustInvoiceTable[1] { CustInvoiceTable };
try
{
testws.FTIS.EntityKey[] returned = service.create(FreeTextInvoice);
testws.FTIS.EntityKey returnedValues = (testws.FTIS.EntityKey)returned.GetValue(0);
Console.WriteLine("Valor retornado: " + returnedValues.KeyData[0].Value);
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.ToString());
Console.ReadLine();
}
}