There are two types of web services in Dynamics 365 Business Central ™ (Navision): SOAP and OData. For a question, which one would be better, the correct answer could be "depending on":
It would be just unfair and too simplistic to say "SOAP is fixed, dead. Now almost everything is connected via REST-Api". The two types of web services are used for different tasks. Roughly speaking, the SOAP is mostly used where operations or tasks should be exposed. REST/OData (OData is a standardization of REST) is used where the resources should be exposed. The most important differences are summarized in the following table.
Some additional comments about using web services in Navision:
In the demo version of Business Central, some good examples of web services have already been set up. They can be listed quickly in the search field (Alt + Q)
On the list of existing web services, we select the "Chart of accounts". There are URLs to web services in the last three columns.
Before the link can be called, it still has to be checked whether the SOAP or OData web services are allowed. These can be set up with the PowerShell Commandlet or manually in BC Administration. If an error occurred while switching on 'Die URL-Reservierung konnte nicht hinzugefügt werden. Fehler: 87 Falscher Parameter.', It may be, the name used has not allowed character (in our example we used a local user in our test environment - which normally is not the case - 'Konrad Seccount').
Not the nicest solution, but we have adjusted the name accordingly in "Local users and groups" with Command lusrmgr.msc.
After restarting the service, the web services can be called with the link. Then we are asked for an authentication.
And then the page will access as SOAP.
Existing methods in the SOAP Web services:
URL: http://x2:15048/BC150/OData/Company('CRONUS%20AG')/Kontenplan. Result:
Microsoft REST API Development Guidelines are available at this Link. In our next step filters are set to show some of OData's most important features - the query possibilities. For this we need the following filter operations:
And an example with a REST Api REQUEST. Structured URL Request: http://x2:15048/BC150/OData/Company('CRONUS%20AG')/Kontenplan?$filter=No eq '0001'&$select=No,Name. The result:
An example of how to build a REST OData web service in Business Central is shown in this post.
Dynamics 365 Business Central TM (Navision) Developer and Consultant Konrad Buczkowski