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 AX (Archived)

Exception of type 'Microsoft.Dynamics.Ax.Xpp.InvalidRemoteCallException' was thrown.

(0) ShareShare
ReportReport
Posted on by 3,732

Hi,

I created a custom service that writes data into excel. I used the following classes to write datas in to excel "

SysOperationProgress progress = new SysOperationProgress();
SysExcelApplication sysExcelApplication;
SysExcelWorkbooks sysExcelWorkBooks;
SysExcelWorkbook sysExcelWorkBook;
SysExcelWorkSheets sysExcelWorkSheets;
SysExcelWorkSheet sysExcelWorkSheet;
SysExcelWorksheet sysExcelWorkSheetToBeDeleted;"

I called the custom service from C# WCF application. I get the following error "Exception of type 'Microsoft.Dynamics.Ax.Xpp.InvalidRemoteCallException' was thrown." but when I use the same code in job and execute it, the data is written into excel successfully. When I wrap this job as a custom service, to consume it from C# WCF, I get the above error.

When I browse regarding this error I found that it is because of the "Sysexcel" class I am using in the code. Am I correct? Can you help me for this solution.

*This post is locked for comments

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

    If you run it in a job, it runs as X++, on client, under your account, in an interactive session. If you run it as a web services, it executes in CIL, on server, under AOS service account etc. Simply put, you're comparing two different things.

    One obvious problem is that SysExcelApplication must run on client and there is no client if running as a web service.

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Martin,

    Thanks for your immediate response. Now I understood the problem accurately.  My requirement is to consume the AX custom service from c# wcf, so I need to create client for "SysExcelApplication" class. Can you answer me, How to create client for "SysExcelApplication" class when running it as web service.

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Web services are handled directly by AOS; there is no AX client involved at all.

    What are you trying to implement?

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Martin,

           Actually i am trying to make one custom AIF service for Ax Product export to excel for that i have created one custom class with one method. The method will read data from tables and write it on excel using SysExcelApplication Class.

           I called that Aif custom service in Ax Job and products exported to excel successfully but when i tried to call it from Visual studio WCF Service application i am facing the following exception.

          "Exception of type 'Microsoft.Dynamics.Ax.Xpp.InvalidRemoteCallException' was thrown."

           Is there any alternative way to export product data to excel or csv and i need to call it from Visual studio.

  • Suggested answer
    Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    If you want to have a service that asks AX to generate a file, you simply can't use SysExcelApplication class, because it can't run in CIL. My suggestion is calling the Data Import Export Framework, becuase that's clearly the right tool for data export. You have other options, though, such as .NET SDK for Excel or generating CSV (which is just a text format).

    Or maybe you would like the service to direct return data and you would do something with them in your .NET application.

  • Suggested answer
    Community Member Profile Picture
    on at

    please post whole job, which you have exposed as service.

    Looking into the whole logic will help finding any statement which is not valid executing through WCF webservice.

    I suspect

    SysOperationProgress progress = new SysOperationProgress();

    this is having some dialog box show up, which i think is not valid when executing through WCF

    Please verify and let us know your findings.

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Nitesh,

    Class CustomClass

    {

    }

    public str getjob()

    {

    #aviFiles

    SysExcelApplication applivcation;

    ;

    application = SysExcelApplication::construct();

    return "Test";

    }

    In the above code I am just trying to use the "SysExcelApplication" class.

    I also tried by removing "#aviFiles" line even though I am facing this same issue. Can you help me....

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans