Custom services - AIFCollectionAttribute attribute usage - need help

Hello,

I am trying to publish my custom service and every time I try to deploy my service and or try to do incremental CIL the DAX is shutting down. It seems like it is something to do how I have used the AIFCollectionAttribute in my DataContract.

Here is what I have in my DataContract:

  1. Two string variables at threir class level varaibles and two parameters that accept a string and returns a string values.

  2. one List variable at the class level and its parameter that accepts a List variable and returns a List variable.

Here is the code that I have for the list parameter:

[DataMemberAttribute("TransIdsList"),
 AifCollectionTypeAttribute("_transIdsList",Types::String),
 AifCollectionTypeAttribute("return",Types::String)]
public List parmTransIdsList(List _transIdsList = lstTransIds)
{
    lstTransIds = _transIdsList;
    return lstTransIds;
}

Here is the service class code that accepts the above DataContract as a parameter from the .NET application.

[SysEntryPointAttribute(true),AifCollectionTypeAttribute('_transIDsDC', Types::Class)]
public  ACResultDataContract invoicePropose(TransIdsDataContract _transIdsDC)
{
    //service method code...
}

Please review the attributes that I have code both in the DataContract and also in the service class method. May be I am missing something on the correct usage of the attributes.

DAX version : 2012 CU3

Thanks,

Dave

Why do you have AifCollectionTypeAttribute for _transIDsDC if the data type (TransIdsDataContract) isn’t a collection?

Hello Martin,

That is what I am trying to understand and get it working. As I had explained above the _transIDsDC parameter is the datacontract that has two string parameter and one List parameter (that gets the list of TransIds from the third party application).

In the main service method, I was trying to see both the [SysEntryPointAttribute(true),AifCollectionTypeAttribute(’_transIDsDC’, Types::Class)] attributes
and also just the [SysEntryPointAttribute(true)] attribute and see if it works. In both the cases it is shutting down DAX. So, not sure which one to use/how to get it working when I have a List parameter in my datacontract which is the input to the main, invoicePropose(TransIdsDataContract _transIdsDC).

All right, let me say it explicitly: specifying the collection type for something that isn’t a collection (such as TransIdsDataContract object) doesn’t make sense. Remove it.

Regarding the crash, first review if your List really contains strings, then compile X++ and generate CIL. If it fails, please check the event logs.