Custom Web Service in few steps D365FO
In this article, I will explain how we can create a basic custom Web Service in D365FO with few steps.
Step-1 Create a class with the name of IntegrationService and write a method get foo.
Reference screenshot
public class IntegrationService
{
public str getFoo()
{
return "Hello World";
}
}
Step-2 Create Add new Service and associate your class with newly created service
Reference screenshot
Step-3 Class association with service.
Reference screenshot
Step-4 Add the method of your class in the service operations node that you want to expose.
Reference screenshot
Step-5 Add a Service group and associate your service with the service group.
Step-6 Set the service property Auto deploy= YES
Reference screenshot
Step-7 Perform Build & Sync and verify from browser.
Reference screenshot
Service URL
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/[ServiceGroupName]/[ServiceName]/[MethodName]
Sample
https://usnconeboxax1aos.cloud.onebox.dynamics.com/api/services/IntegrationGroup/IntegrationService/getfoo
Follow this link to consume web service using POSTMAN