上QQ阅读APP看书,第一时间看更新
Creating the NAV web service
The scope of our application is to read NAV sales orders and create new ones by invoking the NAV business logic. In order to do that, we need to publish the NAV Sales Order page as web service and use it.
Let's learn how to create a NAV web service by performing the following steps:
- Open the Microsoft Dynamics NAV RoleTailored Client and go to the Web Services page.
- Create a new record with these parameters:
- Object Type:
Page
- Object ID:
42
(Sales Order page) - Service Name:
SalesOrder
(a friendly name for our web service) - Published:
TRUE
The results are shown in the following screenshot:
- Object Type:
- When published, NAV immediately gives you the service URL (SOAP and OData). You can test if the web service is correctly working by accessing it directly via the browser (using, for example, the SOAP URL):
- If the browser prompts you to insert credentials for the service, access it by using a correctly configured user in NAV.
- Remember that in order to access the published web services, the service ports (
7047
for SOAP web services and7048
for OData web services if you use the default ones) must be opened to the outside by creating correct rules on the Windows Firewall: