Dynamics AX 2009:无法使用AxdCustomer Class通过Web服务保存新客户

时间:2011-06-03 06:58:16

标签: dynamics-ax-2009

 CustomerService CustService = new CustomerService();

        try
        {               
            CustService.Credentials = new NetworkCredential("xxx", "xxx", "xxx");
            AxdCustomer customer = new AxdCustomer();
            AxdEntity_CustTable[] table = new AxdEntity_CustTable[1];
            AxdEntity_CustTable test = new AxdEntity_CustTable();

            test.AccountNum = TextBox1.Text;
            test.Name = TextBox1.Text;
            test.CustGroup = DropDownList1.SelectedItem.Value;
            table[0] = test;

            customer.CustTable = table;
            CustService.create(customer);
        }      

        catch (Exception ex)
        {
            err.Visible = true;
            lblerr.Text = ex.Message;
        }

我是Dynamics AX的新手。我正在尝试创建一个实际上通过从Web使用Web服务创建的客户。上面的代码片段是代码,但它给出了一个例外:

Request Failed. See the Exception Log for details.

我甚至没有得到它没有被创建的实际原因。如何在动态AX 2009 sp1中创建客户?

注意:CustService是CustomerSvc名称空间中类的CustomerService对象(它是Dynamics中CustomerService Web服务的Web服务引用)。

1 个答案:

答案 0 :(得分:1)

查看托管webservice和AOS的服务器中的事件日志。 你可能会从那里得到一半的线索。

另请参阅AX中可以获取的异常日志 基本 - >定期 - >应用程序集成框架 - >例外

一旦你得到错误的详细信息,你就可以找出问题,否则将它们发布在这里,我可以进一步了解问题所在。