1

AX データベースからベンダーのリストを取得しようとしています。

aspx ページにベンダーのリストを表示したいのですが、どうすればこれを実現できますか?

これが私がこれまでに行ったことです

1-Ax Web サービスをデプロイしました。2-サービスを呼び出すクライアント クラスを作成しました。

ここで立ち往生しており、データを取得する方法がわかりません。

ご意見をお聞かせください。

4

2 に答える 2

2

私はそれを行う方法を見つけました.AIF Webサービスを消費する方法に関する解決策は次のとおりです。コードは次のとおりです.次の記事を参照して ください http://msdn.microsoft.com/en-us/library/cc652581.aspx

        customerService.CustomerServiceClient sc = new ConsumingAxWebService.customerService.CustomerServiceClient();

         AxdCustomer axdCustomer;

        QueryCriteria queryCriteria;
        CriteriaElement[] criteriaElements;
        IEnumerator enumerator;
        int iCountLoops1 = 0;
        AxdEntity_CustTable cust;


        criteriaElements = new CriteriaElement[1];
        criteriaElements[0] = new CriteriaElement();

        criteriaElements[0].DataSourceName = "CustTable";
        criteriaElements[0].FieldName = "AccountNum";
        criteriaElements[0].Operator = Operator.Range;
        criteriaElements[0].Value1 = "1101";
        criteriaElements[0].Value2 = "1102";


        queryCriteria = new QueryCriteria();
        queryCriteria.CriteriaElement = criteriaElements;
        axdCustomer = sc.find(queryCriteria);

        enumerator = axdCustomer.CustTable.GetEnumerator();

        while (enumerator.MoveNext())
        {
            ++iCountLoops1;
            cust = (AxdEntity_CustTable)enumerator.Current;
            Response.Write(cust.AccountNum + "\n");
        }
于 2011-01-13T09:34:31.070 に答える
0

日付と私は Ax の Web サービスに 10 進数を移動できるので、私が使用しているサービスの名前は CustFreeTextInvoice ..

文字列データを渡すことは問題ありませんが、日付と 10 進数データ自体を渡します。

コードを添付...

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();
        }
    }
于 2011-11-16T15:50:47.177 に答える