After you create a web service in the RoleTailored client, you must publish the web service so that it is available to service requests over the network. Users can discover web services by pointing a browser or a tool such as Visual Studio at the computer running Microsoft Dynamics NAV Server and requesting a list of available services. When you publish a web service, it is immediately available over the network for authenticated users. All authorized users can access metadata for Microsoft Dynamics NAV web services, but only users who have sufficient Microsoft Dynamics NAV permissions can access actual data.

Creating and Publishing a Web Service

The following steps explain how to create and publish a web service.

To create and publish a web service

  1. Open the RoleTailored client.

  2. In the Search box, enter Web Services, and then choose the related link.

  3. In the Web Services page, choose New.

  4. In the Object Type column, select Codeunit, Page, or Query.

    Note
    Codeunit and Page are valid types for SOAP web services. Page and Query are valid types for OData web services.
  5. In the Object ID column, select the object ID of the object that you want to expose.

    When the database contains multiple companies, you can choose an Object ID specific to one of the companies.

  6. In the Service Name field, assign a name to the web service.

    Note
    The service name is visible to consumers of your web service and is the basis for identifying and distinguishing web services, so you should make the name meaningful. If you are setting up integration with Microsoft Outlook using codeunit 5313, then you must use DynamicsNAVsynchOutlook as the service name.
  7. Select the check box in the Published column.

  8. Choose OK to close the New - Web Services page.

After you publish a web service, it is available on the Microsoft Dynamics NAV Server computer that you were connected to when you published. The web service is available across all Microsoft Dynamics NAV Server instances running on the server computer—not just the one the RoleTailored client was using to connect when you published.

You can verify the availability of that web service by using a browser.

To verify the availability of a web service

  1. Start Windows Internet Explorer, and in the Address field, enter a URI. For SOAP web services, use the following format for your URI:

    http://<Server>:<SOAPWebServicePort>/<ServerInstance>/WS/<CompanyName>/services.

    For example:

    http://localhost:7047/DynamicsNAV70/WS/CRONUS International Ltd./services

    The company name is case-sensitive and is optional.

    For OData web services, use the following format for your URI:

    http://<Server>:<ODataWebServicePort>/<ServerInstance>/OData/Company('<CompanyName>')

    For example:

    http://localhost:7048/DynamicsNAV70/OData/Company('CRONUS International Ltd.')

    The company name is case-sensitive and is optional.

  2. Review the information that is displayed in the browser. Verify that you can see the name of the web service that you have created.

See Also