Hello there,
I have been trying to execute a codeunit function in C#. I have already got the web service accessible and working. The issue is I have a similar coding executing on one system (developer version) perfectly, but when I use the same coding on the target machine (customer version) I get an exception while executing that particular function…Here is part of my coding:
NavWebservice.WSCM1_PortClient client = new NavWebservice.WSCM1_PortClient();
client.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(“Administrator”, “enbis8home”);
client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
//I get the error on this line:
client.ErstelleErfassungsSheet(abnahmestelle, periode, berichtsID, ref filecontent);
And this is the exception I get on the target version:
The value of INDEXING parameter 1 is outside of the permitted range. The current value is: 9. The permitted range is: from 0 to 0.
I am also finding it difficult to identify which one is the indexing parameter? The parameters passed above are as follows:
abnahmestelle → string
periode → string
berichtsID → string
filecontent → passed as a ref string (in navision this parameter is defined as a variable passed by reference → marked as VAR)
Although I have imported the same codeunit from the developer version, and this starnge exception occurs. What could be the reason. If anyone could Please help?