How to get Service operations from Services

Hello All,

I am looking for an API / method that can list the service operations for a Service. I am using the Microsoft.Dynamics.Ax.Xpp.MetadataSupport::ServiceNames() to get all the services. Each service can have one or more operations. I need the list of operations. The purpose of this is to get the Roles that can Invoke the service operation.

Thanks in Advance!!!

I’ve written a blog post for you: Getting service operations from metadata (D365FO).

Here is the code:

using Microsoft.Dynamics.AX.Metadata.MetaModel;
using Microsoft.Dynamics.Ax.Xpp.AxShared;
class Demo
    public static void main(Args _args)
        AxService service = MetadataShared::Provider.Services.Read('DimensionService');
        System.Collections.IEnumerator enumerator = service.ServiceOperations.GetEnumerator();
        while (enumerator.MoveNext())
            AxServiceOperation operation = enumerator.Current;

Thanks a lot Martin. It worked…