Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Microsoft Dynamics AX 2012 Services

You're reading from  Microsoft Dynamics AX 2012 Services

Product type Book
Published in Dec 2012
Publisher Packt
ISBN-13 9781849687546
Pages 196 pages
Edition 1st Edition
Languages

Consuming the service


Now that we have created and exposed our custom services, they are ready to be consumed. To do this, we use Visual Studio and write two code samples.

Example 1 – Retrieving titles

This first example of consuming the service deals with the retrieval of a title list. We want to be able to write a list of titles to the console window.

Adding the service reference

To add the service reference, perform the following steps:

  1. In Visual Studio, create a console application.

  2. Right-click on the Service References node and select the Add Service Reference… button. The Add Service Reference window opens.

  3. In the Address drop-down box, specify http://DYNAX01:8101/DynamicsAx/Services/CVRCustomServices as the address for the service and then press Go. The address is queried and the services and operations that are available are listed.

  4. In the Namespace dialog box, specify the namespace that you want to use: AxCustomServicesRef.

After performing these steps, the Add Service Reference window should...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}