从Dynamics AX 2009中使用斧头Web服务和C#读取数据 [英] Fetching data from dynamics ax 2009 using Ax webservices and C#

查看:236
本文介绍了从Dynamics AX 2009中使用斧头Web服务和C#读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图获取供应商的名单从AX数据库。

I am trying to fetch the list of vendors from the AX database.

我想告诉我的aspx page.How供应商的列表,我可以做到这一点?

I want to show a list of vendors in my aspx page.How can i achieve this?

这是我迄今所做的

1,部署斧web服务。 2,创建一个客户端类来调用服务。

1-Deployed the Ax webservices. 2-Created a client class to call the service.

我在这里,不知道如何获取数据卡。

i am stuck here and not sure how to fetch the data.

请咨询。

推荐答案

我发现了怎么办it..here的解决方案,如何消费AIF webservices.here是code.手电筒参考以下文章 http://msdn.microsoft.com/en-us/library/cc652581.aspx

I found out how to do it..here is the solution as to how to Consume AIF webservices.here is the code.Please refer the following article 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");
        }

这篇关于从Dynamics AX 2009中使用斧头Web服务和C#读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆