Quantcast
Channel: Dick Wenning's Activities
Viewing all articles
Browse latest Browse all 1245

Iterate .net array of objects in X++

$
0
0

Hi,

I have to consume external web service from AX 2012. I have an wsdl URL so I add Service reference to my class library project in visual studio, compile and deploy the assembly to AX. Visual studio creates a proxy classes as expected. I wrote an AX job in which I create request to the web service. Everithing works fine. I have a response which consist of array of objects (from some type). My problem is that I can't find a way to iterate throughout these objects from the response.

I did the following:


MyResponseClass    response; (has a member with my object's array)

MyObjects[]             objArr;

MyObject                 obj;

int                            i;

response = request.get_Response();

objArr = response.get_MyObjects().

for (i = 0; i <= objArr.get_Length() - 1; i++)   // there is an intelisence for get_Length() method

{

obj = objArr.get_Value(i);

}

When I execute the job I faced the following error:

get_Length() is not a member of MyObjets.

 


Is there any way to iterate throughout complex .net types in X++?

p.s.

If I do the same in Visual Studio I can iterate throughout MyObjects.

BR,

ist.


Viewing all articles
Browse latest Browse all 1245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>