Transcript Mod 1-AIF
Microsoft Dynamics AX 2009 Integration and Development with .NET Framework Application Integration Framework
Agenda
• Common Integration Scenarios and Options • What is Application Integration Framework (AIF) • Enabling Microsoft Dynamics AX as a Service Platform • AIF Service Model – Programming Model – Service Deployment – WCF Services • Service Lifecycle: Compose, Expose, Consume
Common Integration Scenarios
Integration Scenarious and Options • Application to application (A2A) integration
– Synchronize data between applications
• Business to business (B2B) integration
– Implement automated business processes between trading partners
Business Process: Orders-to-Cash
Price/Discount Agreement Price List Purchase Requisition Sales Order Picking List ASN Packing Slip Customer Purchase Invoice Sales Invoice Light Company
Integration Scenarios
System Customer Light Company AX Internet Web Services Customer Vendor XML Web Services BAPI System Application SAP Vendor
Integration Technologies Microsoft Dynamics AX
Trading Partners Third-Party Systems BizTalk Server 2006 XML XML XML Direct X++ API Calls CLR Interop .NET Business Connector Web Services AOS Microsoft Dynamics AX Asynchronous Transports AIF
What is Application Integration Framework
What Is AIF
• Application Integration Framework (AIF) is the infrastructure within Microsoft Dynamics AX to exchange data with other systems • AIF enables B2B and A2A integration • Data is exchanged using XML documents • AIF has adapter-based and Web service types of exchange
AIF Exchange Types
• • There are two methods for exchanging data in AIF:
Web services
- a data exchange in which a MSDAX service is called by an external system.
Adapters
- a data exchange in which
MSDAX
adapters are used to communicate with the external system.
MSDAX
adapters support the following transport mechanisms: – File system – Microsoft Message Queuing (MSMQ) – BizTalk Server
Basic AIF Concepts
Axd<Document> AIF DB 11010110011 Local Endpoint AIF Services Service Operations AOS Microsoft Dynamics AX Expose Consume Endpoints Web Service Client Async Channels XML Document
Enabling Microsoft Dynamics AX as a Service Platform
Services Platform
Enable Microsoft Dynamics AX for Service Oriented Architecture (SOA) Framework for creating and managing services Support for document and custom services Data exchange in form of XML documents Configurable transport infrastructure Extensible X++ framework Flexible architecture
How Does AIF Enable SOA?
• Readily available business logic – Service contract – Service implementation – Data types and schemas • Tools and Programming model – Compose services – Exposing services – Consuming services • Platform – Value added components – Various transports – Communication infrastructure
Windows Communication Foundation (WCF) • Designed for building service-oriented apps • WCF is the interface for service communication • Uses config file to specify service interface • Provides the following features: – Unified programming model – Integration to Microsoft Visual Studio – Interoperability with other platforms – Attribute-based programming – WS-* protocol support – Extensibility location transparency – Message-oriented programming
WCF: Address, Binding & Contract
• • • A Service
Endpoint
has an Address, a Binding, and a Contract (ABC)
Address
- indicates
where
the service is located
Binding
- specifies
how
a client can communicate with the endpoint including transport protocol, encoding, and security requirements
Contract
- identifies
what
operations are available to the clients
Client C B A Address Where?
Binding How?
Endpoint
A B C A B C A B C Service Contract What?
AIF Service Model
AIF in Microsoft Dynamics AX 2009
• Create and Expose AIF services: – New programming model – Update and Delete functionality • Consume external web services: – Web references • WCF based Services Infrastructure • Target: Internet Facing Services
AIF Service Model • AIF Service consists of: – Service contract – Service implementation – Data types • AIF Service flavors – AIF services • Generic service type • Arbitrary service operations and data types – Entity services • Services based on Queries • Typically CRUD+ functionality
Programming Model • Define service contract – Write an X++ interface • Implement service – Write an X++ class that implements the contract • Implement data types – Write the X++ classes used as parameters in the Service contract – Provide custom serialization • Use AIF Services – From within the Microsoft Dynamics AX application – Published as WCF Services
WCF Services • Key Features – Design time • Implement AIF services as reusable X++ classes • Publish (X++) AIF services as WCF services • Client programming experience, WS Addressing, Standards (WS Security, WS-Reliable Messaging, etc.); .NET 3.0, Perl, Java, etc.
– Configuration time • Leverage rich set of WCF configuration parameters • Extend functionality through behaviors, custom bindings, etc.
• Separate infrastructure configuration from application configuration – Runtime • Benefit from .NET Framework 3.0 runtime • Standardized, consistent external interface • Make business functionality and data available to other applications in the enterprise network and to trading partners
Service Lifecycle: Compose, Expose, Consume
Compose AIF Services
• Prerequisites: – Developer license • General steps: – Define contract – Implement contract – Compile artifacts – Register service • Use Service Wizard to: – Create a query – Configure the query – Generate service – Customize service – Build service – Register service
Generate AIF Service
Axd<Document > query defines XML structure and content SalesTable Axd<Document> class performs serialization and deserialization XML SalesLine ...
...
Ax<Table> classes manage data access DB
XML Schema Structure
<
SalesOrder
xmlns="http://schemas.microsoft.com/dynamics/">
Hidden Empty
<
SalesTable
class="entity"> <
CaseTagging
>No
SalesLine
class="entity">
<
InventDim
class="entity">… <
DocuRefHeader
<
DocuRefHeader
class="entity">… class="entity">…
Generate WCF Service
• The service generation framework is responsible for creating: – WCF Service contracts and operation contracts from X++ interface/classes – Types and Schemas for parameters and return types.
– WCF Configuration file
Service Deployment (WCF) • Prerequisites – Set up host (for example, IIS6, IIS7) – Configure service deployment in Microsoft Dynamics AX client • Publish AIF Service as WCF Service – Generate managed code – Generate WCF configuration file – Deploy WCF service artifacts (for example, to IIS) – Perform advanced WCF configuration, if needed
• • • •
Consume External Web Services
Consume any Intranet/internet services Generate client side proxy using WCF Configure client side with standard WCF configuration files – Provide rich developer experience: Easy to add web reference. Similar to VS – – CLR Interop and Intellisense support in X++ Support to work with strongly typed classes referencing services
AIF Services is Key Advantage
• AIF is best practices for accessing AX data from external systems and some MorphX scenarios
Demo
Compose Web Service
Expose AIF Service
• Prerequisites: – Service is ready for use • Steps: – Configure transport – Configure external components (if applicable) – Configure security (if necessary) – Publish service
Demo
Expose Web Service
Consume Web Service
• Prerequisites: – Get access to the Web service definition (WSDL) • Steps: 1. Create Web reference 2. Build Web reference 3. Write application code 4. Compile application code 5. Use the external service as part of the business process
Demo
Consume Web Service
Q&A
Introducing the Lab
• In this lab you will: – Create a new AIF service and all the needed X++ artifacts with the help of AIF service wizard – Extend this service with custom service operations – Consume the AIF service from the .NET application
© 2008 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.