
Note: The following steps show you how to consume an external StockQuote service by using X++.
- Open Visual Studio as an administrator.
- Go to File > New > Project.
- In the New project dialog box in the left column, select Visual C# under the Templates node.
- Select Class Library from the list in the middle column.
- Enter ExternalServiceLibrary for the name.
- Select OK.
- In the Solution Explorer window, right-click the ExternalServiceLibrary node.
- Select Add Service Reference.
- Enter your organization’s web service in the Address field.
- Select OK.
- In the Solution Explorer window, right-click the ExternalServiceLibrary node.
- Select Add > New Item.
- Select Code in the left column, and then select Class in the middle column.
- Name the class ExternalServiceClass.
- Wrap the StockQuote service operation.
- Perform a build by right-clicking the ExternalServiceLibrary project in the Solution Explorer.
- Select Build. The binary ExternalServiceLibrary.dll is created.
- Select File > New > Project.
- In the New project dialog box in the left column, select Dynamics 365 under the Templates node.
- Select Finance Operations from the middle column.
- Enter ExternalServiceLibrary in the Name field and select OK.
- In the Solution Explorer window, right-click the ExternalServiceLibrary node.
- Select Add Reference.
- Select ExternalServiceLibrary.dll from the Add reference dialog box.
- Select OK.
- Open the Class in the References node in the Solution Explorer window.
- Use the external web services that were referenced in ExternalServiceLibrary.dll.