
Hello,
I'm working on adding custom web service to Dynamics GP API. For that I use pdf instruction from microsoft https://www.microsoft.com/en-us/download/details.aspx?id=36223 (or here: https://vdocuments.site/ws-programmers-guide.html)
Accordingly to instruction, to add Policy Metadata, we need create Windows Console App (page 223, Chapter 29: Adding Policy Metadata) and run it inside C:\Program Files\Microsoft Dynamics\GPWebServices folder.
but when I run app it throws an error: Object reference not set to an instance of an object.
on line of code:
PolicyBusinessService policyBusinessService = (PolicyBusinessService)ServiceFactory.GetServiceInstance(CommonConstants.PolicyBusinessService);
When I debug it, same error
Inner exception is null, stack trace:
at Microsoft.Dynamics.Common.ServiceFactory.GetServiceInstance(String serviceKey)
at InstallPolicyMetadata.Program.LoadPolicies() in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 50
at InstallPolicyMetadata.Program.Load() in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 92
at InstallPolicyMetadata.Program.Main(String[] args) in C:\Users\user1\Source\Repos\gpsyncextension\src\InstallPolicyMetadata\Program.cs:line 114
Tool has references to all DLLs from C:\Program Files\Microsoft Dynamics\GPWebServices folder as specified in instruction.
What is wrong? Why internal Dynamics API web services method returns error?
Thank you,
Igor
*This post is locked for comments
I have the same question (0)