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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Consume Custom AIF service In AX

(0) ShareShare
ReportReport
Posted on by

HI 

We Have multiple instance AX Server. I want transfer data between ax instances through AIF Services.

1- Created a Custom Services in AX1 and Consumed That service  in Dot net Project and Add to AOT.

  AIF Requires a list data as input parameter. below my code

CLRObject clientType;
List dtaheadlist = new List(Types::Class);
CLRObject ClrObject;
int integer;
str string;
System.Exception ex;
AXSERVICE.Creation.ACXHPWSSERVICEClient _client;
AXSERVICE.Creation.ACXHPWSSERVICE _service;
AXSERVICE.Creation.AcxDATACONTRACT[] Hdata;
AXSERVICE.Creation.AcxDATACONTRACT hdclass;
AXSERVICE.Creation.CallContext calcontext;
new InteropPermission(InteropKind::ClrInterop).assert();

try
{
clientType =CLRInterop::getType("AXSERVICE.InCreation.ACXHPWSSERVICEClient");
_client = AifUtil::CreateServiceClient(clientType);
hdclass = new AXSERVICE.Creation.AcxDATACONTRACT();


hdclass.set_TRANSFER("YES");

hdclass.set_LocationIdFrom("16001');

hdclass.set_RequestId("PR-0001233");

 Hdata   = new AXSERVICE.Creation.AcxDATACONTRACT[1]();

  Hdata.Add(hdclass);  // Here receiving ERROR  please guide me this correct 

      result= _client.dataindentwithdetails(calcontext,Hdata);

}

}
catch(Exception::CLRError)
{

ex = CLRInterop::getLastException();
info(ex.ToString());
}

}

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at

    If you get an error, the first step is finding more information about the error. First of all, look at the error message. Then you can also debug the code.

    If you need our help, make sure you share all the details with us.

  • Suggested answer
    AhmedMgamal Profile Picture
    75 on at

    you don't provide us with any detail about the error so it is very hard to identify the issue you face , but can you try to use set SetValue method instead of add it may work with you.

    let us know more about that.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans