Compiler Error and Web Service

I"m running into a compiler issue. I’m trying to consume an external web service. When I compile my class I get a “overflow in an internal compiler stack” error. For the web service, I need to pass 100 variables. I have discovered that in Ax 2009, you can only pass 98 variables before you get a stack overflow error. Does anyone know a work around for this?

Thanks in advance,

Ms.Newbie

Generate your service proxy with the message contract. The method will then accept one parameter, the contract object. You’ll fill properties of this object and pass it to the service method.

It may be impossible to generate proxies with message contracts using AX2009 service references (I’ve never tried it). But you can generate in Visual Studio (when adding service reference, go to Advanced… and check Always generate message contracts). Build it as class library, add it as assembly reference to AOT and call it from X++.

Hi Martin,

If i’m understanding you correctly, I am doing what you are suggesting. The only thing is, the service method is requiring me to pass 100 variables. If I don’t the function is not recognized. I worked through this example http://www.microsoft.com/en-us/download/details.aspx?id=4462 . In the example the service method would be getCurrencyValue, right?

Thanks,

ms.newbie

What I’m suggesting is that instead of using a method with 100 primitive parameters, you could use a method with a single complex parameter. The parameter would be a class with 100 properties (contract class).

As I said, I doubt that you can do it via service references in AX, but you definitely can control it when generating the service client in Visual Studio.

Thanks Martin! Your suggestion worked. :slight_smile:

Hi Martin,

I am also facing this issue, if I try to write it on the 99th value on CSV its throwing error like “Overflow in an internal compiler stack.”.

But I am using Microsoft Dynamics AX 2012 R2. But I need to write all my details on X++ only not in some other way.

Can you help me???

How is a CSV file related to number of parameters of a web service (which is the topic of this thread)?

Hi Martin,

I am writing all this values in CSV. But my problem is I couldn’t pass more that 98 values.

Okay, so let’s stop discussing it an a thread about web services. Create a new thread (with appropriate name and tags) and explain the problem in detail there. Don’t forget to tell us how you’re writing to the file.

Thanks martin we followed the steps 3 or 5 times from the srctach and issue got resolved… not sure what was mistake i was doing now AX 2012 r3 data is getting imported