Notifications
Announcements
No record found.
Hi all,
Can anyone help me?I have a web service( WCF) that returns datatable. I call service from AX. I want to save the datatable of the service at AX.
*This post is locked for comments
Do I understand correctly that you successfully receive the a DataTable object but you don't know how to read data from it, or maybe how to create a table record inside AX?
If you explain your problem in detail, it'll become easier for others to help you.
If you are able to call the web service and cast the return value into a System.Data.DataTable object, then all you need to do is to read out the data from it. Which part are you having difficulty with? Here is the documentation with examples and properties/methods of the DataTable object:
msdn.microsoft.com/.../system.data.datatable(v=vs.110).aspx
Web service:
public DataTable Test()
{
DataTable dt = new DataTable();
dt.Columns.Add("Code",typeof(string));
dt.Columns.Add("Name",typeof(string));
dt.Rows.Add( new object[]{ "123","abc"});
dt.Rows.Add(new object[]{"123","cde"});
return dt;
}
I want to read datatable (webservice) in ax 2012.
thanks for your reply.
hi Martin,
Ok, we understood this part that you have a web service that returns a DataTable, but what are you having trouble with in your AX code?
hi Vilmos Kintera,
I want to read the table by x ++ but I do not know how to do it
[View:https://technet.microsoft.com/en-us/library/hh500185.aspx:750:50]
[View:http://yetanotherdynamicsaxblog.blogspot.hu/2013/10/consuming-web-service-in-ax-2012-is-easy.html:750:50]
Now you have all the details required to know. How to call external services from AX code, and what namespace can be used for accessing DataTable information.
Combine all of the above, it should not be a problem for any developers, since you have a lot of examples already.
Please make sure you mark helpful answers next to each post.
hi Vilmos Kintera ,
For example, you send data list. You can navigate based on the code I send
I still don't see any explanation of what problem you have when you try to get the value returned by Test(). Did you try it at all? If so, what problem did run into? Or does it mean that you don't know how to consume web service in general? In that case, read Consuming Web Services.
The only piece of code you gave is the web service, although your problem is somewhere else.
By not explaining what you need, you make it very difficult for others to help you, which is clearly not in your best interest.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2