You are previewing Microsoft Dynamics AX 2012 R2 Services.
O'Reilly logo
Microsoft Dynamics AX 2012 R2 Services

Book Description

Using Microsoft Dynamics AX to create and run your own services is made plain sailing with this in-depth tutorial. Covering everything from document services to building customized services and batch processing, it’s the complete guide.

In Detail

Integrating Microsoft Dynamics AX 2012 with other applications will always be necessary within any organisation, and services is the best way of achieving this. With Microsoft Dynamics AX 2012 being more flexible than ever when it comes to creation and use, understanding these services will help you to know when and where to use them for the best result.

Starting from ground up, we will build your knowledge of Microsoft Dynamics AX 2012 R2 Services through step by step tutorials, to give you the ability to create and use the most suited service to the task at hand.

Starting with service architecture and deployment, we'll quickly take you through to AIF Document services and on to creating custom services for all of your AX needs. This second edition also features information on high availability, load balancing and creating clusters so that you can get the most of your AX services. We then conclude with tracing and debugging, to troubleshoot and monitor running services.

What You Will Learn

  • Use the AIF Document Service Wizard
  • Create custom services in X++
  • Configure enhanced integration ports
  • Deploy services using a variety of protocols
  • Consume your services in .NET
  • Consume external web services in X++
  • Use the SysOperation framework to create batch processes
  • Set up tracing and debugging
  • Downloading the example code for this book. 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.

    Table of Contents

    1. Microsoft Dynamics AX 2012 R2 Services
      1. Table of Contents
      2. Microsoft Dynamics AX 2012 R2 Services
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
          3. Instant Updates on New Packt Books
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with Microsoft Dynamics AX 2012 Services
        1. Introducing services and SOA
          1. Example implementations
            1. Bing API
            2. Mobile application
            3. Business Process Modeling (BPM)
        2. Architectural overview
        3. New and enhanced features
          1. The AOS WCF service host
          2. WCF adapters
          3. Integration ports
          4. IIS hosting without Business Connector
          5. Non-XML support
        4. AIF change tracking
        5. Custom services
        6. The SysOperation framework
        7. Types of services
          1. Document services
          2. Custom services
          3. System services
            1. The query service
            2. The metadata service
            3. The user session service
            4. The OData query service
          4. Choosing the right service for the job
            1. Complexity
            2. Flexibility
        8. Summary
      9. 2. Service Architecture and Deployment
        1. Introducing WCF
          1. Existing technologies
          2. The ABC of WCF
        2. Service deployment
          1. Service operations
          2. Inbound versus outbound ports
            1. Inbound ports
            2. Outbound ports
          3. Basic versus enhanced ports
            1. Basic ports
              1. Creating a basic port
            2. Enhanced ports
              1. Creating an enhanced port
              2. Adapters
              3. Service operations
              4. Data policies
              5. Transforms
              6. Pipelines
              7. Value mapping
              8. Document filters
              9. Troubleshooting
              10. Security
        3. Bindings
        4. Adapters
          1. The NetTcp adapter
          2. The HTTP adapter
          3. The filesystem adapter
          4. The MSMQ adapter
          5. The Windows Azure Service Bus adapter
          6. Custom adapters
        5. Service generation - under the hood
          1. Generated artifacts
            1. Service contract and implementation
            2. Message contracts
          2. WCF configuration storage
        6. The power of CIL
          1. CIL output
        7. Summary
      10. 3. AIF Document Services
        1. Introducing document services
        2. Key components
          1. The document query
          2. The document class
            1. Responsibilities of a document class
              1. XSD generation
              2. XML serialization and deserialization
              3. Cross-table business logic
              4. Validation and business rule enforcement
          3. AxBC classes
            1. Responsibilities of an AxBC class
              1. Performing validation
              2. Providing field sequencing
              3. Performing value mapping
              4. Setting default values
          4. The service class
          5. The service node
        3. Creating a document service
          1. Setting the compiler level
          2. Creating the query
          3. Running the AIF Document Service Wizard
            1. Selecting document parameters
            2. Selecting code generation parameters
            3. Generating code
          4. Finishing up
            1. Fixing compiler errors
              1. ClassDeclaration
              2. The cacheObject() method
              3. The cacheRecordRecord() method
            2. Fixing tasks
              1. Labels
              2. Generating an XSD schema
              3. Constraints
              4. Validation
            3. Updating the service contract
            4. Fixing best practice errors
            5. Privileges
            6. Setting mandatory fields
        4. Updating an existing document service
          1. Adding service operations
          2. Updating supporting classes
        5. Deploying a document service
        6. Consuming a document service
          1. Create
          2. Find
            1. Creating query criteria
            2. Using Find
          3. Read
          4. FindKeys
          5. Update
          6. Delete
          7. GetKeys
            1. Document filter
            2. Using GetKeys
          8. GetChangedKeys
        7. Asynchronous communication
        8. The send service framework
        9. Batch processing
        10. Summary
      11. 4. Custom Services
        1. Key components
          1. Attributes
            1. Custom services attributes
          2. Data contracts
          3. Service contracts
          4. Collection types
        2. Creating custom services
          1. The Title service
            1. Creating the Title data contract
            2. Creating the Title list data contract
            3. Creating the Title service class
            4. Creating the Title service operation
            5. Creating the Title list service operation
            6. Creating the Title service contract
        3. Deploying services
        4. The rental service
          1. Rental header and line tables
          2. Rental service operations
          3. Rental data contracts
          4. The createRental service operation
        5. Consuming services
          1. Example 1 – retrieving titles
            1. Adding the service reference
            2. Consuming the service
          2. Example 2 – registering a rental
            1. Creating the service reference – advanced
              1. Always generate message contracts
              2. Collection type
              3. Consuming the service
        6. Summary
      12. 5. The SysOperation Framework
        1. SysOperation versus RunBaseBatch
        2. Creating a SysOperation service
          1. The data contract
            1. Declaration and members
            2. Query helper methods
          2. Service and service operation
          3. Menu item
          4. Testing
          5. Validation
          6. Defaulting
        3. Running a SysOperation service
          1. Service and service operation
          2. Execution modes
            1. Synchronous
            2. Asynchronous
            3. ReliableAsynchronous
            4. ScheduledBatch
        4. Custom controllers
          1. Usage scenarios
            1. Initializing the data contract
            2. Dialog overrides
          2. Creating a controller
            1. Declaration
            2. The main() method
            3. Constructor
            4. Menu item
            5. Testing
        5. Custom UI Builders
          1. Creating a UI Builder
            1. Declaration
            2. The override method
            3. The postBuild() method
            4. Linking the UI Builder to the data contract
            5. Testing
        6. Multithreading
          1. The individual task approach
          2. The helper approach
          3. Enabling multithreading
        7. Summary
      13. 6. Web Services
        1. Installing Visual Studio tools
        2. Visual Studio development
          1. Introducing the USA zip code service
          2. Creating the Visual Studio proxy library
          3. Adding a service reference
        3. X++ development
          1. Deploying managed code
            1. Deploy to Server
            2. Deploy to Client
          2. Consuming the web service
            1. First attempt
            2. Fixing configuration issues
            3. Deploying between environments
            4. Final result
        4. Summary
      14. 7. System Services
        1. Introducing system services
          1. Presenting a demo application
        2. The metadata service
          1. Filling the combobox
        3. The query service
          1. Fetching data for the grid
          2. Paging the results
        4. The user session service
          1. Retrieving user information
        5. The OData query service
          1. Creating and publishing a data source
            1. Creating a query
            2. Setting up document data sources
          2. Consuming the OData query service using Internet Explorer
          3. Consuming the OData query service using Visual Studio
            1. Adding a service reference
            2. Fetching data for the grid
          4. Consuming the OData query service using other applications
          5. Limitations
        6. Summary
      15. 8. High Availability
        1. Introducing high availability
          1. Adding redundancy
          2. Disaster recovery
        2. Putting high availability into practice
          1. The basic architecture
          2. Application-level load balancing
            1. Configuring the cluster
            2. Adding a dedicated load balancer
          3. Network Load Balancing
          4. NLB for AX load balancers
          5. NLB for services
        3. Summary
      16. 9. Tracing and Debugging
        1. Installing development tools
        2. Using the Microsoft Dynamics AX 2012 debugger
          1. Debugging the SysOperation framework
          2. Testing service operations
        3. Using the Visual Studio debugger
          1. Launching Visual Studio
          2. Attaching the debugger to the AOS
          3. Setting breakpoints
          4. Debugging a service call
        4. Using the Tracing cockpit
          1. Collecting a trace
        5. Using the integration port logging mode
          1. Configuring the logging mode
          2. Consulting the log
        6. Using WCF message logging and tracing
          1. Configuring message logging and tracing
          2. Analyzing service traces
            1. Analyzing message logging
            2. Analyzing tracing
        7. Summary
      17. A. Installing the Demo Application
        1. Prerequisites
        2. Dynamics AX 2012 models
          1. Using PowerShell
          2. Using AxUtil
        3. Dynamics AX XPO file
        4. Code snippets
        5. Initializing number sequences
        6. Visual Studio code
          1. Opening the samples
          2. Modifying the service references
        7. Sample data
      18. Index