31,19 €
Because an ERP system like Microsoft Dynamics AX 2012 plays a central role in an organization, there will always be the need to integrate it with other applications. In many cases, services are the preferred way of doing this, and Microsoft Dynamics AX 2012 is now more flexible than ever when it comes to the creation and use of these services. Understanding these services will help you identify where they can be used, and do so effectively."Microsoft Dynamics AX 2012 Services" is a hands-on guide that provides you with all the knowledge you will need to implement services with Microsoft Dynamics AX 2012. The step-by-step examples will walk you through many of the tasks that you need to perform frequently when creating and using services."Microsoft Dynamics AX 2012 Services" provides detailed and practical examples for creating and using services that will make it a resource you will consult many times during your implementationsThis book helps you to identify situations where services can be used for your implementations. By providing step-by-step instructions for many of the common tasks, you will gain practical know-how on to get the job done.Easy to follow instructions are provided for all types of services you will encounter. You will learn how to create document services using the AIF Document Service Wizard and how to use X++ to create custom services. You will also learn how to deploy services and web services and how you can consume them in both X++ and .NET. The services are also put to use in the SysOperation framework, which uses services to run business logic and is the new way to create batch processes in Microsoft Dynamics AX 2012.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 221
Veröffentlichungsjahr: 2012
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2012
Production Reference: 1141212
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-754-6
www.packtpub.com
Cover Image by Artie Ng (<[email protected]>)
Authors
Klaas Deforche
Kenny Saelen
Reviewers
Palle Agermark
José Antonio Estevan
Tom Van Dyck
Acquisition Editor
Mary Jasmine Nadar
Commissioning Editor
Meeta Rajani
Technical Editors
Manmeet Singh Vasir
Dominic Pereira
Project Coordinator
Shraddha Bagadia
Proofreaders
Aaron Nash
Stephen Silk
Indexer
Hemangini Bari
Graphics
Valentina D'silva
Aditi Gajjar
Production Coordinator
Prachali Bhiwandkar
Cover Work
Prachali Bhiwandkar
Klaas Deforche started working as a developer on Microsoft Dynamics AX in 2007 for the Belgian ICT company RealDolmen, primarily working with Dynamics AX 4.0. He gained experience with AX 2009 while working on projects for some well-known Belgian fashion retailers, especially on the integration side of things. He is currently working on AX 2012 projects for customers in the healthcare sector. Klaas likes to share his knowledge with the community, which is why in 2009 he started his AX-oriented blog artofcreation.be.
I would like to thank everyone involved in the making of this book; coauthor Kenny, everyone at Packt Publishing for the opportunity they have given us, and especially the reviewers for their efforts.
Also, I want to acknowledge that writing a book is really hard, not just for the author, but also for the people around them. I always thought that authors were overdoing their thanking, but I can assure you it's quite the opposite. In that respect, thanks to my family, colleagues, friends, and girlfriend for their patience and support.
Also, a big thanks to the readers of my blog, fellow bloggers, and the Dynamics community.
Kenny Saelen works for the Belgian ICT company RealDolmen. He started as a developer on Microsoft Dynamics AX in 2004 primarily working on a European customer implementation with Dynamics AX 3.0. At RealDolmen, he gained experience with Dynamics AX 2009 while implementing AX internally, followed by a project for a books wholesale company. Currently, he is working as a technical architect for a worldwide customer implementation with Microsoft Dynamics AX 2012, mainly working towards integrating Dynamics AX with other technologies such as Sharepoint, Biztalk, and AgilePoint. He can be reached through his blog ksaelen.be.
I would like to thank everyone involved in making this book happen, starting with my coauthor Klaas for all the hours we've spent together writing it. Many thanks to everyone at Packt Publishing for the opportunity they have given us, and to the technical reviewers for providing us with the right alternative insights.
Special thanks to my girlfriend and my little son. Writing this book has proven to be much harder than I initially thought, but they have been patiently supporting me all the way.
Palle Agermark has spent nearly 20 years in the ERP industry, specializing in Microsoft Dynamics AX, and before that was released in 1998, its predecessor Concorde XAL. Palle has worked for many years at Microsoft Development Center Copenhagen in Denmark, primarily with development on the financial, accounts payable, and accounts receivable modules.
In 2006, Palle wrote the chapter Extending Microsoft Dynamics AX in Inside Microsoft Dynamics AX 4.0, Microsoft Press.
Currently, Palle works for one of Denmark's largest Microsoft Dynamics AX partners; Logica, now part of CGI.
Palle lives in Denmark, in the Copenhagen area, with his wife Rikke and daughter Andrea.
José Antonio Estevan has been a technical consultant and developer on Dynamics AX since 2008. He has more than 10 years of experience in software development, the last 6 on Dynamics AX since version 4.0. José Antonio is certified in Dynamics AX 2009 and 2012, and has worked on many projects in different sectors with very different requirements, delivering solutions in the form of new developments and integration with all kind of external systems. He has recently been awarded the MVP award from Microsoft.
José Antonio is from Alicante, Spain, but is now living and working in Madrid. He likes to read books, ride his motorbike, and write for the Dynamics AX community on his blog www.jaestevan.com.
Tom Van Dyck is a software engineer and technical consultant for Dynamics AX and currently works for a Microsoft partner in Belgium.
After completing a degree in Computer Science and a few years of Visual Basic, ASP, and SQL programming, he began working with AX in 2004.
Being part of different project teams building a variety of solutions based on AX versions 3.0, 4.0, 2009, and 2012, he has built up a wide practical experience.
Tom is a certified professional for AX with expertise in X++ development, and has a special interest in performance issues and optimization.
I've had the privilege to work with both Kenny and Klaas, and know them as devoted and experienced professionals.
To me this book confirms what I already knew; these guys have a well-thought-out opinion that deserves to be heard. My sincere congrats for the effort and passion they've put into the writing of this book!
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.
Since an ERP system like Microsoft Dynamics AX 2012 plays such a central role in an organization, there will always be the need to integrate it with other applications. In many cases, services are the preferred way of doing this, and Microsoft Dynamics AX 2012 is now more flexible than ever when it comes to the creation and use of these services. Understanding these services will help you identify where they can be used, and do so effectively.
Microsoft Dynamics AX 2012 Services is a hands-on guide that provides you with all of the knowledge you will need to implement services with Microsoft Dynamics AX 2012. The step-by-step examples will walk you through many of the tasks you need to perform frequently when creating and using services.
Chapter 1, Getting Started with Microsoft Dynamics AX 2012 Services, introduces the concept of services and explores the new features and enhancements made to them in Microsoft Dynamics AX 2012.
Chapter 2, Service Architecture and Deployment, dives deeper into the service architecture and explores the different options that are available when deploying services.
Chapter 3, AIF Document Services, focuses on the creation, deployment, and consumption of AIF document services.
Chapter 4, Custom Services, will show you how to create and deploy custom services and consume them using a WCF application using new concepts such as attributes.
Chapter 5, The SysOperation Framework, builds upon the knowledge gained from developing custom services to demonstrate how you can run business logic in Microsoft Dynamics AX 2012 using services and the SysOperation framework.
Chapter 6, Web Services, walks you through the steps needed to consume an external web service in Microsoft Dynamics AX 2012 using Visual Studio integration.
Chapter 7, System Services, demonstrates how powerful system services that are provided out-of-the-box can be, and how they allow you to build applications faster.
To use the example code files provided with this book, the following prerequisites must be available.
A full list of software requirements can be found in the Microsoft Dynamics AX 2012 System Requirements document available for download at http://www.microsoft.com/en-us/download/details.aspx?id=11094.
When you are developing for Microsoft Dynamics AX 2012, you will certainly come into contact with services, even outside of integration scenarios. Because of that, this book is aimed at all Microsoft Dynamics AX developers, both new and those experienced with services and Microsoft Dynamics AX 2012.
This book assumes no other knowledge than a basic understanding of MorphX and X++. Even beginners will be able to understand and complete the examples in this book. Those new to services will get the most out of this book by doing a complete read-through, but those who are experienced can jump right in. The idea is that this book can be used both to educate yourself and as a resource that can be consulted during development.
Some examples use C#.NET, so experience with Visual Studio is a plus but not a must. This book is not aimed at .NET developers.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Microsoft Dynamics AX 2012 introduces a lot of new features that are related to the Application Integration Framework (AIF) and services in general. Many of the existing concepts have been radically changed. This chapter unveils these new features and enhancements made to services in Microsoft Dynamics AX 2012.
At the end of this chapter, you will have a clear picture of what services are all about in the context of Microsoft Dynamics AX 2012. This should enable you to identify where and when to use services in your solution, and what type of service to use.
The following topics are covered in this chapter:
So what is a service? The best way of understanding what a service is, is by understanding why you would need a service. Typically, there are a lot of different applications being used in an enterprise. Sometimes this is by design, for example, because a specialized functionality is needed that is not implemented in the ERP system. In other cases legacy systems are not replaced when implementing an ERP system, simply because they do their jobs well. Whatever the reasons, these or others, the result is the same: a growing number of different applications.
One of the problems with these applications is that they are likely to have been built using different technologies. Because they speak a different language, it makes them unable to communicate with each other. This is a problem that services address by providing a means by which applications can communicate, independent of their technology. They achieve this by adhering to standards and protocols so that in essence they start speaking the same language.
A service should have many of the same qualities as modern applications. Applications should be modular, components should be reusable, and everything should be loosely coupled. These principles also apply when developing services. Your services should have a well-defined functionality, and should be able to autonomously execute that functionality without interaction with other services.
Services should also be abstract. By this we mean that other applications should not have to know the inner workings of the provider in order to use the service.
A service is also self-describing, meaning it can provide other applications with metadata about itself. This metadata describes what operations can be used, and what the input and output is. In the case of Microsoft Dynamics AX, this information is published using the Web Service Description Language (WSDL).
All of these qualities make services usable in a Service-Oriented Architecture (SOA). In an SOA, services are published and made discoverable. Services are then composed to create loosely coupled applications.
To make the previous explanation about services more concrete, we will take a look at three very different scenarios in which services can be used.
Microsoft provides an API for Bing Maps and Search that is available to developers in various ways, including a web service. Developers can use this service for things such as calculating a route between two addresses, locating an address on a map, getting search result for a certain query, and so on.
It's not hard to imagine this service being used in a logistics application, for example, to calculate the most efficient route for delivering goods to customers.
Let's look at a scenario where a mobile application has to be developed for Microsoft Dynamics AX 2012. Even if your mobile application contains business logic to work offline, data will have to be sent back to the Application Object Server (AOS) at some time. The mobile application could use services to execute business logic and send data to the AOS when a network is available.
A mobile application can also be built without containing business logic, in a way that it only renders a Graphical User Interface (GUI). In this scenario, the application will have to stay connected to the AOS over the network because the AOS will drive the application and tell it what to do using services.
You can use services in an SOA to model business processes. When all requirements for the business processes are available as services, it is possible to compose processes entirely using services. When done right, this is very powerful because of the great flexibility that the combination of BPM and SOA provides.
Depending on the requirements of your projects, a different architectural approach will be needed. To make the right decisions when designing your solutions, it is important to understand the services and AIF architecture.
Compared to Microsoft Dynamics AX 2009, there have been a lot of improvements made to the service architecture in Microsoft Dynamics AX 2012. The biggest improvement is the native Windows Communications Foundation (WCF) support. As a result the proprietary Microsoft Message Queuing (MSMQ) and BizTalk adapters that were available in Microsoft Dynamics AX 2009 have been deprecated and replaced by adapters that use WCF. The file system adapter remains intact, and still allows you to import and export messages from and to the file system.
All services are WCF services and are hosted on the AOS. When an application wants to consume these services on the local network, no further deployment is needed, because it can connect directly to the AOS. Just like with Microsoft Dynamics AX 2009, deployment on Internet Information Services (IIS) is needed for consumers that are not on the intranet. However, the services themselves are no longer deployed on IIS; instead a WCF routing service on the IIS routes everything to the AOS.
If you want to modify messages before they are received or after they are sent, you can use pipelines and transformations. Pipelines only apply to the body of a message, and are handled by the request preprocessor and response postprocessor. You can use transformations to transform a complete message including the header. This allows you to exchange messages in non-XML format.
While not displayed in the diagram, there is now load balancing support for services using Windows Server Network Load Balancing (NLB). Combined with NLB for IIS that was already available, this enables high availability and load balancing for services.
Services have been around for some time in Microsoft Dynamics AX. AIF was initially introduced with the release of Microsoft Dynamics AX 4.0 and Microsoft Dynamics AX 2009 continued to build on that. But now with the latest release of Microsoft Dynamics AX 2012, Microsoft has really succeeded in bringing the service functionality to a whole new level. Let us take a walk through the major changes that Microsoft Dynamics AX 2012 brings to the table.
The first major feature that has been added to this release is that the AOS is now the host for the Microsoft Dynamics AX 2012 services. In previous releases, the exchange of messages was either through adapters such as the file system, BizTalk, and MSMQ adapter, or services that were exposed as WCF 3.5 services through IIS. With the latter, IIS was acting as the host for the WCF services.
