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)

AIF service "did not run correctly"

(0) ShareShare
ReportReport
Posted on by 535

My issue is I am getting an error on my call to the method in AX from the windows service.

Error:

Error getLabelInfo - (LabelService) did not run correctly: An error occurred. - 8/10/2016 6:45:17 PM
mscorlib

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoService.GetLabelData(LoftwareLabelInfoServiceGetLabelDataRequest request)
at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoServiceClient.ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoService.GetLabelData(LoftwareLabelInfoServiceGetLabelDataRequest request) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Service References\LoftwareLabelService\Reference.cs:line 3371
at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoServiceClient.GetLabelData(CallContext CallContext) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Service References\LoftwareLabelService\Reference.cs:line 3377
at ServiceTestApp.Form1.button1_Click(Object sender, EventArgs e) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Form1.cs:line 74 System.Collections.ListDictionaryInternal

Windows Code:

ServiceTestApp.LoftwareLabelService.LLContract[] returnMessage = new ServiceTestApp.LoftwareLabelService.LLContract[0];

            DataSet dataSet;
            //Paging paging = null;

            AifSos.LoftwareLabelInfoServiceClient proxy = new AifSos.LoftwareLabelInfoServiceClient();

            proxy.ClientCredentials.Windows.ClientCredential.UserName = "svc_axbcproxy";   //kmundt
            proxy.ClientCredentials.Windows.ClientCredential.Password = "mc@C0nn3ct";   //sears

            AifSos.CallContext LabelContext2;

            LabelContext2 = new AifSos.CallContext();




Ax Code:

[SysEntryPointAttribute(true),
AifCollectionTypeAttribute('return',Types::Class,classStr(LLContract))]
public List GetLabelData()
{
#define.Description("Windows Label Record Retrievable")
    SMCLabelsLoftware           labelsloftware;
    SMCDefsLoftwareLabelsDtl    LabelsDtl;
    SysDictTable                sysDictTable;
    str                         fieldname;
    int                         i;
    Struct                      finalstruct, labelsStruct = new Struct(Types::String, 'FieldID', Types::AnyType,'Value', Types::AnyType, 'labelname' );
    List                        finallist, labelsList = new List(Types::Class);
    ListEnumerator              listEnum;

    try
    {
        ttsbegin;

                while select labelsloftware where labelsloftware.PrintedStatus == ''
                {
                    sysDictTable = new SysDictTable(tableNum(SMClabelsLoftware));

                    for(i=1;i<= sysDictTable.fieldCnt();i++)
                     {
                         fieldname = SysDictTable.fieldName(sysDictTable.fieldCnt2Id(i));
                         if(SMCDefsLoftwareLabelsDtl::find(labelsloftware.LabelName,SysDictTable.fieldName(sysDictTable.fieldCnt2Id(i))))
                         {
                             labelsStruct.value('FieldID',fieldName);
                             labelsStruct.value('Value',labelsloftware.(sysDictTable.fieldCnt2Id(i)));
                             labelsStruct.value('labelname',labelsloftware.LabelName);

                             labelsStruct.pack();
                             labelslist.addEnd(labelsStruct);
                         }
                     }
                }

                
        ttscommit;
        return labelsList;

}

*This post is locked for comments

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

    What's the type of the exception and does it have any inner exceptions?

    What if you debug GetLabelData?

  • KeithM Profile Picture
    535 on at

    It gives the classic mscorlib inner exception. This all errors on the line to return the data. returnMessage = proxy.GetLabelData(LabelContext2);   Get label data runs just fine when I run it in a job in AX.

    Error getLabelInfo - (LabelService) did not run correctly: An error occurred. - 8/11/2016 12:46:02 PM

    Inner Exception: mscorlib

    Server stack trace:

      at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

      at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

      at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

      at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:

      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

      at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

      at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoService.GetLabelData(LoftwareLabelInfoServiceGetLabelDataRequest request)

      at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoServiceClient.ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoService.GetLabelData(LoftwareLabelInfoServiceGetLabelDataRequest request) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Service References\LoftwareLabelService\Reference.cs:line 3371

      at ServiceTestApp.LoftwareLabelService.LoftwareLabelInfoServiceClient.GetLabelData(CallContext CallContext) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Service References\LoftwareLabelService\Reference.cs:line 3377

      at ServiceTestApp.Form1.button1_Click(Object sender, EventArgs e) in c:\Keith_Documents\SolutionFilesDotNet2013\ServiceTestApp\ServiceTestApp\Form1.cs:line 74

    Data: System.Collections.ListDictionaryInternal

  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    mscrolib is a library, is not an exception. An exception is an object of System.Exception type (or a child type).

    That your code runs fine in a job isn't important. If you're mentioning a reaction to my suggestion to debug the code, you have to debug what doesn't work (the service) and not something else (such as a job).

  • KeithM Profile Picture
    535 on at

    That is running/debugging the code in the service. It gets to the line returnmessage = proxy.GetLabelData(LabelContext2) and bombs.   The inner exception gives me that  mscorlib. That is why it's frustrating considering it is a library. 

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
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans