web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

.net interop - array problems

(0) ShareShare
ReportReport
Posted on by

Hi Forum,

I am working with one of my navision collegues in aspects of integrating a simple webservice into nav2013. I am the .net guy...

In order to work with the webservice within navison I've created a simple dll wrapping the webservice. The dll contains no business logic - only a web reference to the external service.

The problem is that one of the webservice methods return an array of objects - the type looks like this:
public Aspect4Integration.Aspect4AccountWS.GetallaccountsResponseGenreralledgerdata[] genreralledgerdata { set; get; }

As You can see the type seems to be an array containing objects of type:
public class GetallaccountsResponseGenreralledgerdata

From within a .net test app it would be pretty simple to handle this:

//create return type
Aspect4Integration.Aspect4AccountWS.getallaccountsResult result = new Aspect4Integration.Aspect4AccountWS.getallaccountsResult();
//calling the webservice
result = client.getallaccounts(allAccountsRequest);
//handle the respone
Aspect4Integration.Aspect4AccountWS.GetallaccountsResponseGenreralledgerdata[] ld = result.response.genreralledgerdata;

 

But how do we do something similar in navision?

Within navision we can create a single object of the GetallaccountsResponseGenreralledgerdata type:
A4_GetNewAccountData := A4_GetNewAccountData.GetnewaccountsResponseGenreralledgerdata;

 

But when trying to create an array, nav seems to be treating the array declaration as a nav array.

 

Any advice would be very much appreciated.

 

Regards,

Torben Philippsen

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Roberto Stefanetti Profile Picture
    12,998 on at

    Hi,

    some links about .NET Interoperability & Arrays

    NAV 2009 R2 .Net Interop: using arrays / collections

    forum.mazzy.ru/index.php

    NAV 2009 R2 .Net Interop: using arrays / collections

    community.dynamics.com/.../nav-2009-r2-net-interop-using-arrays-collections.aspx

    .Net Interop: example in using arrays/collections

    download @ www.mibuso.com/dlinfo.asp

    NAV 2009 R2 .Net Interop: Calling a Web Service

    dynamicsuser.net/.../nav-2009-r2-net-interop-calling-a-web-service.aspx

    How do I pass an array as a method result to Microsoft NAV?

    stackoverflow.com/.../how-do-i-pass-an-array-as-a-method-result-to-microsoft-nav

    Microsoft Library:

    Extending Microsoft Dynamics NAV Using Microsoft .NET Framework Interoperability

    msdn.microsoft.com/.../gg502499.aspx

    Using .NET Framework Arrays

    msdn.microsoft.com/.../gg502469.aspx

  • Community Member Profile Picture
    on at

    Hi Roberto,

    Thank You very much for your reply. Especially the article dynamicsuser.net/.../nav-2009-r2-net-interop-calling-a-web-service.aspx was of great help.

    I've marked your reply as "verified answer".

    Best regards,

    Torben

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans