Table of ContentsIntroduction0-1Welcome
............................................................................................................
0-1
Microsoft Dynamics Courseware Contents
........................................................ 0-2
Documentation Conventions
..............................................................................
0-3
Student Objectives
.............................................................................................
0-4
Chapter 1: Introduction to Services and Application Integration
Framework1-1Objectives...........................................................................................................
1-1
Introduction.........................................................................................................
1-1
Concepts
............................................................................................................
1-2
Integrations.........................................................................................................
1-9
Summary
..........................................................................................................
1-14
Test Your Knowledge
.......................................................................................
1-15
Quick Interaction: Lessons Learned
.................................................................
1-16
Solutions...........................................................................................................
1-17
Chapter 2:
Architecture2-1Objectives...........................................................................................................
2-1
Introduction.........................................................................................................
2-1
High Level Features and Concepts
....................................................................
2-2
Topology.............................................................................................................
2-7
Usability
..............................................................................................................
2-9
Support for Data Model Changes
.....................................................................
2-14
Summary
..........................................................................................................
2-15
Test Your Knowledge
.......................................................................................
2-16
Quick Interaction: Lessons Learned
.................................................................
2-17
Solutions...........................................................................................................
2-18
Chapter 3: Installation and
Upgrade3-1Objectives...........................................................................................................
3-1
Introduction.........................................................................................................
3-1
Installation
..........................................................................................................
3-2
Lab 3.1 - Configure Services to Use IIS
...........................................................
3-16
Lab 3.2 - Install
MSMQ.....................................................................................
3-19
Upgrade............................................................................................................
3-22
Summary
..........................................................................................................
3-29
Test Your Knowledge
.......................................................................................
3-30
Quick Interaction: Lessons Learned
.................................................................
3-31
Solutions...........................................................................................................
3-32Microsoft Official Training Materials for Microsoft
DynamicsiYour use of this content is subject to your current
services agreementApplication Integration Framework and Services
inMicrosoft Dynamics AX 2012Chapter 4:
Administration4-1Objectives...........................................................................................................
4-1
Introduction.........................................................................................................
4-1
Set Up Batch
......................................................................................................
4-2
Lab 4.1 - Set Up Batch
.......................................................................................
4-6
Integration Ports
.................................................................................................
4-9
Adapters
...........................................................................................................
4-15
Summary
..........................................................................................................
4-24
Test Your Knowledge
.......................................................................................
4-25
Quick Interaction: Lessons Learned
.................................................................
4-27
Solutions...........................................................................................................
4-28
Chapter 5: Development
Concepts5-1Objectives...........................................................................................................
5-1
Introduction.........................................................................................................
5-1
Service
Types.....................................................................................................
5-2
Document Services
............................................................................................
5-7
Lab 5.1 - Add Validation and Defaulting to a Web
Service............................... 5-24
Lab 5.2 - AIF Document Service Wizard
.......................................................... 5-25
Custom Services
..............................................................................................
5-27
System
Services...............................................................................................
5-27
How AIF Exchanges Data
................................................................................
5-31
Customizing the AIF Pipeline
...........................................................................
5-41
Business Operations Framework
.....................................................................
5-52
Lab 5.3 - Business Operations Framework
...................................................... 5-56
Security
............................................................................................................
5-58
Summary
..........................................................................................................
5-64
Test Your Knowledge
.......................................................................................
5-65
Quick Interaction: Lessons Learned
.................................................................
5-68
Solutions...........................................................................................................
5-69
Chapter 6: Working With
Services6-1Objectives...........................................................................................................
6-1
Introduction.........................................................................................................
6-1
Call an External Service
.....................................................................................
6-2
Create and Call a Custom Service by Using a Basic
Port.................................. 6-6
Lab 6.1 - Create and Call a Custom Service by Using a Basic
Port................. 6-10
Call a Document Service by Using NetTcp
...................................................... 6-13
Lab 6.2 - Call a Document Service by Using NetTcp
....................................... 6-17
Call a Document Service with the File Adapter
................................................ 6-20
Lab 6.3 - Call a Document Service with the File Adapter
................................. 6-26
Create a Synchronous Document Exchange between BizTalk and AIF
.......... 6-30
Exchange Documents by Using the MSMQ
Adapter........................................ 6-36
Call the Metadata Service
................................................................................
6-42iiMicrosoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreementTable of ContentsLab 6.4 - Call the User Session
Service...........................................................
6-46
Create and Deploy Outbound
Exchange..........................................................
6-48
Lab 6.5 - Create and Deploy an Outbound
Exchange...................................... 6-60
Summary
..........................................................................................................
6-67
Test Your Knowledge
.......................................................................................
6-68
Quick Interaction: Lessons Learned
.................................................................
6-69
Solutions...........................................................................................................
6-70
Chapter 7: Troubleshooting and
Logging7-1Objectives...........................................................................................................
7-1
Introduction.........................................................................................................
7-1
Monitoring Services and AIF
..............................................................................
7-3
Troubleshooting................................................................................................
7-10
Lab 7.1 - Debugging Services
..........................................................................
7-16
Summary
..........................................................................................................
7-19
Test Your Knowledge
.......................................................................................
7-20
Quick Interaction: Lessons Learned
.................................................................
7-21
Solutions...........................................................................................................
7-22Microsoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreement
iii
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012ivMicrosoft Official Training Materials for
Microsoft DynamicsYour use of this content is subject to your
current services agreementChapter 1: Introduction to Services and
Application Integration FrameworkCHAPTER 1: INTRODUCTION TO
SERVICES AND APPLICATION INTEGRATION FRAMEWORKObjectivesThe
objectives are:Introduction
List the high-level features of Services and Application
Integration
Framework (AIF).
Discuss integration planning and options.
Microsoft Dynamics AX 2012 provides many services that can be
used by the Microsoft Dynamics AX components and with third-party
applications. Services are programmable artifacts in Microsoft
Dynamics AX 2012. There are many
out-of-the-box document services that are shipped with Microsoft
Dynamics AX
2012, which can be used as it is, or customized to fit
requirements. Additionally, new document services can be created,
and any static method call can be exposed as a service.
All customizable application and framework X++ services in
Microsoft Dynamics AX 2012 are compiled to Microsoft Intermediate
Language (MSIL). These services can be grouped together and
deployed to ports, which is a new concept introduced in Microsoft
Dynamics AX 2012. A port represents a Windows Communication
Foundation (WCF) service endpoint. By default, a port is hosted on
the Application Object Server (AOS).
Microsoft Dynamics AX 2012 also ships with three
non-customizable system services: the Metadata service, the Query
service, and the User session service. With these services, clients
can interact with and retrieve system information, thus enabling
the development of more powerful applications, data queries through
Office add-ins, and inquiries into system structure.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-1
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Services and the Application Integration
FrameworkIn Microsoft Dynamics AX 2012, services provide a
first-class programming model for integration and enable the
Microsoft Dynamics AX application to expose its functionality by
means of Windows Communication Foundation-based services.
Concepts
Application Integration Framework (AIF), built on top of
services, supports the processing of incoming and outgoing
messages, such as message transforms and value look ups. Together,
services and AIF provide the programming model, tools, and
infrastructure support for message-based integration of application
functionality and data with Microsoft Dynamics AX.
Services and AIF is composed of a number of concepts.
Distinguishing between these concepts will help provide a building
block for understanding the full capability of Services and AIF.
This lesson briefly introduces the concepts in Services and AIF,
which will be explained in detail in later chapters.
The following table shows the key concepts of Services and
AIF.FeatureDescription
Application Integration
FrameworkThe Application Integration Framework (AIF)
helps users integrate Microsoft Dynamics AX
2012 with other systems that are inside and outside of the
enterprise by allowing for the exchange of data through formatted
XML, and other formats through transforms.
1-2
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkFeatureDescription
ServicesApplication Object Server (AOS) is the Windows
Communication Foundation (WCF) service host for Microsoft Dynamics
AX 2012 services that are exposed to users and applications on an
intranet.
To consume services over the Internet, you must host services on
Internet Information Services (IIS). Services that are hosted on
IIS use the WCF message routing service. IIS routes all service
requests to AOS. All service requests are processed on AOS,
regardless of whether they
originate on the Internet or an intranet. AOS then returns a
response to the service consumer through IIS. Exchanges that are
configured to
use web services are processed synchronously and are therefore
not queued. Microsoft Dynamics AX deploys the service that is based
on Web Services Description Language (WSDL) to a subfolder of the
virtual directory that is associated with the website that you
provide.
Service operationsService operations are the capabilities that
are offered by a service, and include:
create
delete
find
findKeys
getKeys
getChangedKeys
read
update
Service groupsA service group is a collection of services that
are intended to be managed together.
Each service group is associated with one WSDL
rather than having one WSDL for each service, as was the case in
previous versions.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-3
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012FeatureDescription
Integration portsIn Microsoft Dynamics AX 2012, integration
ports provide simplified administration of services and Application
Integration Framework (AIF). Integration ports replace the AIF
endpoints and related concepts that were used in previous releases
of Microsoft Dynamics AX. Each integration port can expose one or
more service operations, and each integration port has a unique
Uniform Resource Identifier (URI) that identifies the address of
the port. The following list shows the available integration
ports:
Basic Inbound Port
Enhanced Inbound Port
Enhanced Outbound Port
AdaptersIn Microsoft Dynamics AX 2012 services and Application
Integration Framework (AIF), integration ports use adapters. These
adapters enable Microsoft Dynamics AX to communicate by using
various transport protocols. Microsoft Dynamics AX 2012 provides
the following four adapters that represent predefined bindings:
HTTP
NetTCP
MSMQ (Microsoft Message Queuing)
File system
MessagesIn Microsoft Dynamics AX 2012 services and Application
Integration Framework (AIF). messages use the SOAP specification,
even for MSMQ and File System adapters. A message is a
self-contained unit of data that can consist of several parts.
These parts include an envelope, body, and header. When AIF
receives and processes an inbound message, it generates an outbound
message in response.
SchemasAIF requires XML documents to follow a specific XML
Schema Definition (XSD). XSD files (which have a .xsd file name
extension) are meta-documents that describe the format, or schema
of XML documents that declare the namespace of the XSD. Each schema
includes rules about the hierarchical arrangement of XML elements,
which elements must be present in the document, and other such
requirements.
1-4
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkFeatureDescription
TransformsTo accommodate for the fixed schema that is required
by AIF, the following transforms were introduced.
eXtensible Stylesheet Language Transform (XSLT) - XML-based
language to transform an XML document to a different XML
document.
.NET assembly - Custom logic to allow a programmer to perform
tasks such as converting a .csv to an .xml document.
Refactored ServicesIn Microsoft Dynamics AX 2012 Microsoft
improved services with the following key areas:
Simple setup and configuration
A first class programming model
Aligning with industry standards
Richer integration of specific features
Performance enhancements
Simple Setup and ConfigurationIn Microsoft Dynamics AX 2012,
user interfaces were simplified. In previous versions of Microsoft
Dynamics AX, there were 17 top-level concepts on menus. Microsoft
Dynamics AX 2012 has four top-level concepts.
Inbound ports
Outbound ports
Value substitution maps
Web sites
Microsoft Dynamics AX 2012 applies the "Progressive Disclosure"
principal to accomplish a more simplistic setup and configuration,
while adding more capabilities. With this applied principal,
administrators are only provided options when they need them. For
example: Service contract customizations are available when you
configure enhanced inbound ports, but not when you configure basic
inbound ports.
In addition to a simplified user interface, the following
changes were made to simplify the experience by using and
administering services and AIF in Microsoft Dynamics AX 2012.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-5
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012ChangeDescription
Services hosted on the AOSThe Application Object Server (AOS) is
the WCF service host for Microsoft Dynamics AX 2012 services.
Services that are hosted on AOS are mainly intended to be consumed
from the intranet.
IIS services hosted without a
.NET Business
ConnectorIn the previous release of Microsoft Dynamics AX,
IIS-hosted services required .NET Business Connector to communicate
with the AOS. In Microsoft Dynamics AX 2012, IIS-hosted services
use the WCF routing service instead of the .NET Business
Connector.
The business connector proxy user account is still required for
running the IIS application pool, and it must match the user
business connector proxy user account that is specified in
Microsoft Dynamics AX system accounts and the business connector
proxy user account that is still used for impersonation.
AutoDeploy property on service groupsThe AutoDeploy property on
service groups allows these groups to be deployed without
administrator interaction.
First Class Programming ModelSome of the steps that have been
taken to transform services into a first class programming model
include the following:
System services like Query service, Metadata data service, and
user session service have been added
No custom code is needed to expose X++ logic as a service
because declarative attributes are now available to help the
developer do this
"Always On" service groups work out-of-the-box
Document service code generation transparently handles the
Microsoft Dynamics AX 2012 data model changes
Align with StandardsMicrosoft Dynamics AX 2012 provides expanded
support for Windows Communication Foundation (WCF), beyond the
basic HTTP and HTTPS bindings. The proprietary BizTalk Server
adapter that is used in the previous releases of Microsoft Dynamics
AX is no longer available. Instead, Microsoft Dynamics AX 2012
provides equivalent functionality through native WCF functionality.
However, custom adapters that were developed by customers and
partners by using the AIF adapter framework continue to be
supported in this release.
1-6
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkNew FeaturesServices and AIF for Microsoft
Dynamics AX 2012 include feature improvements, which are shown in
the following table.
FeatureDescription
Service groupsWith service groups, a developer can group related
services together.
Integration portsIntegration ports provide a simple interface to
control data that is going into and coming out of services and
AIF.
Support for non- XML filesData that is not XML, for example, a
comma-delimited file, can now be imported into and exported from
Microsoft Dynamics AX.
Batched messagingIn Microsoft Dynamics AX 2012, you can submit
large amounts of data by using the batch XML schema. This schema
allows you to group single messages into message sets that can be
submitted together by using a single XML document.
Change trackingIn Microsoft Dynamics AX 2012, you can configure
the database to keep track of when changes happen at the table
level. When so configured, you can use the getChangedKeys service
operation to retrieve entity keys for only those documents that
have changed based on certain criteria, such as a specified date
and time.
Performance improvedSeveral improvements were made to enhance
the overall performance of services and AIF in Microsoft Dynamics
AX 2012.
SecurityMicrosoft Dynamics AX 2012 offers a robust and flexible
security framework. Users are granted access to Microsoft Dynamics
AX based on their assigned role.
Services and AIF rely on WCF for additional security. You can
change the WCF configuration to make necessary security settings
that are required by Microsoft Dynamics AX services. WCF is
responsible for authenticating the user. Service-level
authorization is defined by the integration port configuration.
Improved troubleshootingA new table links message and exception
log data. You can do a full-text search for all records in the
following AIF forms:
Exceptions
History
Queue manager
Debugging was moved to Visual Studio.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-7
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012FeatureDescription
Support data model changesThe document services framework
supports the data model changes that are implemented in Microsoft
Dynamics AX 2012.
Performance EnhancementsThe following list describes
enhancements in services and AIF that result in improved
performance:
Compiled CIL is used to process Services.
To achieve scale and redundancy, you can configure AOS servers
with the Network Load Balancing (NLB) for Microsoft Dynamics AX
services. The AOS-clustering solution affects only the RPC- based
connections and does not allow you to load balance Microsoft
Dynamics AX services.
Client applications can access services through the WCF runtime
without using .NET Business Connector, which was required for
services and AIF in previous releases of Microsoft Dynamics AX.
A deployment on an intranet does not require IIS because
services are now hosted on the AOS by default.
You can host services on IIS for requests that originated from
the Internet; however, the routing service on IIS dispatches these
requests to the AOS host. All service requests, regardless of the
origin, are processed on the AOS.
The services framework uses connection pooling to reduce the
overhead of creating and destroying a session on service calls.
All of the services references are placed in a single web
services description language (WSDL) file. The single helps helps
developers reuse types when they are consuming Microsoft Dynamics
AX services.
ArchitectureMicrosoft Dynamics AX exposes its functionality
through services that are based on Windows Communication Foundation
(WCF) and hosted on Application Object Server (AOS) by default, or
Internet Information Services (IIS) with extra configuration. All
services requests, regardless of their origin, are handled by the
WCF runtime that is hosted on AOS. External applications and
client
applications on the local area network consume Microsoft
Dynamics AX services by accessing them directly from AOS.
1-8
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkIntegrations
These clients and applications include Microsoft Dynamics AX
components such as the Microsoft Dynamics AX client, Office Add-ins
for Microsoft Dynamics AX, and Enterprise Portal for Microsoft
Dynamics AX. Internet-based external applications and clients can
access the Microsoft Dynamics AX services through IIS. IIS routes
the incoming requests for Microsoft Dynamics AX services to
AOS.
Most Microsoft Dynamics AX 2012 implementations will require
integrating with one or more other systems. Some examples of
outside systems that would require integration to Microsoft
Dynamics AX 2012 include:
An ERP in another division
A corporate website
A shipping station
Creating and maintaining these integrations can be one of the
more difficult tasks that are performed in an implementation, and
careful planning should be performed to ensure smooth
implementation and operation of these integrations.
Services and Application Integration Framework (AIF) provides a
capable platform for implementing these integrations.
Integration by Using ServicesIntegrations to external systems
are best implemented by using the services programming model.
Although the weakly-typed and strongly-typed .NET interop to X++
can be used for the integration development pattern, we do not
recommend the use of these technologies for integration. Their
firewall unfriendliness, combined with their dependencies on
Business Connector assemblies make these technologies unfit for
most integration scenarios.
If the functionality that you need is not available in a service
that ships with Microsoft Dynamics AX 2012, you can use the
declarative attributes to expose existing X++ classes and methods
as a service interface.
Service TypesTo support a range of options for customization and
programmability, including writing integrations, Microsoft Dynamics
AX provides the following types of services:
Custom Services are services that you create to expose X++ logic
through a service interface. You can use the business logic with
inbound or outbound transfers.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-9
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Document Services represent data and business logic
within Microsoft Dynamics AX. You can use or customize the over 70
standard Axd document services that are included with Microsoft
Dynamics AX. If none of the standard document services meet your
needs, you can create a new document service by using the AIF
Document Service Wizard.
System Services cannot be customized. The Query Service,
Metadata Service, and User Session Service are Windows
Communication Foundation (WCF) services that are included with
Microsoft Dynamics AX. The services provide access to data that is
returned in queries, metadata for AOT objects such as tables and
extended data types (EDTs), and data about the calling user such as
default
language and default company.Integration PlanningPlanning is an
important part of any data integration effort. When you integrate
Microsoft Dynamics AX with other systems, one of the first steps is
the planning phase. In this phase, the implementation team must
define high-level requirements and make decisions about the design
of the integration. After these requirements are defined, the
partner, IT staff, and development staff can work together to
define the best way to implement the exchange in Application
Integration Framework (AIF).
The decisions that must be made about the design of the
integration fit into two primary categories: decisions about the
data and decisions about the environment.
Data - Central to integration is the data. While planning the
integration, you must make many decisions about the data that is
being exchanged and the associated business rules. This phase often
involves the expertise and knowledge of business users, because
these users understand the meaning of the data and can define the
requirements for integration.
Environment - Configuration requirements define the environment
that is used for integrations. Factors that affect these
requirements include the network configuration, the hardware and
software configuration of the external system, and the level of
trust between Microsoft Dynamics AX and the external system.
1-10
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkBefore integrations are created, we recommend
that the implementation team consider the questions that are
described in the following table.
QuestionEffect on the Design
What data will need to be exchanged?This information helps you
determine whether you can take advantage of an existing document
service. If you cannot, you might have to create a new document
service or a new custom service, or you might have to use one of
the system services.
Is the data sent from Microsoft Dynamics AX to an external
system, or is the data received by Microsoft Dynamics AX from an
external system?This information helps you determine whether you
must use an inbound or outbound integration port.
Is the integration based on the "pull" model or the "push"
model? In the "pull" model, the external system requests data from
Microsoft Dynamics AX. In the "push" model, an event in the
application causes data to be sent to the external
system.This information helps you determine how to configure a
document exchange.
Integrations that pull data into Microsoft Dynamics AX 2012 will
need to use an integrating technology other than Services and
AIF
Is there any business logic that needs to be implemented for
this
integration that would not be found in existing AIF
documents?This information helps you determine whether any
customizations must be made to existing AIF documents.
Do the documents that are sent or received need to be
transformed? Do the transformations have to be performed before
data is sent or when data is received? What is the extent of the
data transformations? Are the transformations performed by
Microsoft Dynamics AX or an external system?This information helps
you determine whether AIF value mapping, .NET transformations, or
XSLT transformations must be used.
Does the external system have any restrictions about how data is
exchanged? In other words, the external system can only create .csv
documents, and it can only save them to the local file system.This
information helps you determine the type of transport adapter that
is required for the exchange.
Is the external system an in-house system or an external trading
partner?This information helps you determine how users and security
must be configured.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
1-11
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012QuestionEffect on the Design
What is the availability of the systems that are being
integrated? What are the requirements for real- time data
exchanges?This information helps you determine whether you must use
synchronous or asynchronous adapters.
What is the volume of transactions?This information helps you
determine which adapters you must use. The information also helps
you determine the scale of the deployment, such as the number of
computers that run Application Object Server (AOS).
Integration Planning ProcessTypical integration scenarios use
document-based exchanges. Whether you require integration with
internal legacy systems or external trading partners, planning for
the integration involves common key steps.
1. In a typical integration scenario, users who have business
expertise first determine the requirements for document exchanges.
These are requirements from a business perspective. The business
users work with the implementation team to determine the following
requirements:
oThe data that must be exchanged
oAny business logic that is related to that data
oThe external systems with which data must be exchanged
oThe conditions under which data is sent from or received by
Microsoft Dynamics AX2. The system implementer works with the IT
staff to determine the hardware and software requirements for
Application Integration Framework (AIF). The system implementer
analyzes the existing environment and recommends any new hardware
or software that must be installed.
3. The IT staff installs and configures any hardware and
software that are required to support AIF, and sets up the required
authentication, encryption, and authorization.
4. A developer programs the document exchange. The developer can
either customize the AIF documents or create new documents to meet
the requirements of the business users. The configuration of AIF
partly depends on the network environment. Therefore, the developer
can work with the IT staff to implement an integration
scenario.
5. The IT staff monitors the document exchanges and
troubleshoots any errors that are generated.
1-12
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkThe following figure provides a high-level
view of the process that is used to integrate Microsoft Dynamics AX
with other systems.
FIGURE 1.1 INTEGRATION PLANNING PROCESS
Skills RequiredThe following are the skills and expertise that
is needed to fully take advantage of services and AIF:
X++ development
C# and Visual Studio
Internet Information Services (IIS) administration, if IIS-based
web services are deployed
Windows Communication Foundation (WCF)Microsoft Official
Training Materials for Microsoft DynamicsYour use of this content
is subject to your current services agreement
1-13
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Summary
Integration concepts, such as enterprise application integration
(EAI), business-to-business (B2B), and synchronous and asynchronous
transports
Microsoft .NET Framework 4.0
Microsoft Message Queuing (MSMQ), if used
Services and AIF for Microsoft Dynamics AX 2012 provide a first
class programming experience for integrations and creating
applications. These technologies allow data to be passed into
external systems from Microsoft Dynamics AX 2012, and into
Microsoft Dynamics AX 2012 from external systems, by using XML and
other formats.
In Microsoft Dynamics AX 2012, services and AIF were refactored
for simplicity, alignment with industry standards, and to add more
capabilities. These changes include:
Reducing high level concepts from 17 to 4
Adding features that allow services and AIF to be used for more
than integrations
Support for WS-* compliant services
Service groups
Support for non XML files
Batched messaging
Change tracking1-14
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkTest Your KnowledgeTest your knowledge with
the following questions.
1. Categorize the following features: 1. Service
Groups
2. Integration port
3. Support for non-XML files
4. Performance improved 5. Support data model changes 6.
Improved troubleshooting
7. Change tracking
8. Batched messaging
a.Service groups help a developer group related services
together.
b. In Microsoft Dynamics AX 2012, you can submit large amounts
of data by using the batch XML schema. This schema helps you group
single messages into message sets that can be submitted together by
using a single XML document.
c.In Microsoft Dynamics AX 2012, you can configure the database
to keep track of when changes happen at the table level. When so
configured, you can use the getChangedKeys service operation to
retrieve entity keys for only those documents that have changed
based on certain criteria, such as a specified date and time.
d. Integration ports provide a simple interface to control data
going into and coming out of services and AIF.
e.Several improvements were made to enhance the overall
performance of services and AIF in Microsoft Dynamics AX 2012.
f.The document services framework supports the data model
changes that are implemented in Microsoft Dynamics AX 2012.
g. In Microsoft Dynamics AX 2009, the troubleshooting and
logging of AIF was performed at the service operation level. In
Microsoft Dynamics AX 2012, services and AIF troubleshooting and
logging is performed at the integration port level.
h. Data that is not XML, for example, a comma- delimited file,
can now be imported into and exported from Microsoft Dynamics
AX.
2. What is the preferred method for integrating to Microsoft
Dynamics AX
2012?
( ) .NET Interop
( ) .NET Business Connector
( ) ServicesMicrosoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreement
1-15
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Quick Interaction: Lessons LearnedTake a moment and
write down three key points you have learned from this chapter
1.2.3.1-16
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 1: Introduction to Services and Application
Integration FrameworkSolutionsTest Your Knowledge1. Categorize the
following features: a 1. Service
Groups
d 2. Integration port
h 3. Support for non-XML files
e 4. Performance improved f 5. Support data model changes
g 6. Improved troubleshooting
c 7. Change tracking
b 8. Batched messaging
a.Service groups help a developer group related services
together.
b. In Microsoft Dynamics AX 2012, you can submit large amounts
of data by using the batch XML schema. This schema helps you group
single messages into message sets that can be submitted together by
using a single XML document.
c.In Microsoft Dynamics AX 2012, you can configure the database
to keep track of when changes happen at the table level. When so
configured, you can use the getChangedKeys service operation to
retrieve entity keys for only
those documents that have changed based on certain criteria,
such as a specified date and time.
d. Integration ports provide a simple interface to control data
going into and coming out of services and AIF.
e.Several improvements were made to enhance the overall
performance of services and AIF in Microsoft Dynamics AX 2012.
f.The document services framework supports the data model
changes that are implemented in Microsoft Dynamics AX 2012.
g. In Microsoft Dynamics AX 2009, the troubleshooting and
logging of AIF was performed at the service operation level. In
Microsoft Dynamics AX 2012, services and AIF troubleshooting and
logging is performed at the integration port level.
h. Data that is not XML, for example, a comma- delimited file,
can now be imported into and exported from Microsoft Dynamics
AX.
2. What is the preferred method for integrating to Microsoft
Dynamics AX
2012?
( ) .NET Interop
( ) .NET Business Connector
() ServicesMicrosoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreement
1-17
Application Integration Framework and Services inMicrosoft
Dynamics AX 20121-18Microsoft Official Training Materials for
Microsoft DynamicsYour use of this content is subject to your
current services agreementChapter 2: ArchitectureCHAPTER 2:
ARCHITECTUREObjectivesThe objectives are:Introduction
Review high level flows in Services and Application
Integration
Framework (AIF).
Discuss the topology of the Services and AIF model.
Describe moving service configurations by using integration
ports in
AIF.
Discuss the new process of change tracking.
Review the transforms that are available for customization in
banking.
Demonstrate Excel Document Service Registration.
Review support data model changes in Microsoft Dynamics
AX2012.
Application Integration Framework (AIF) helps companies
integrate Microsoft Dynamics AX with external business processes
and partners through the exchange of XML over various transport
media.
As mentioned in the "Architecture lesson" of Chapter 1:
Introduction to Services and Application Integration Framework all
services are WCF based and hosted on AOS. When intranet
communication is needed for services that are using IIS, the
requests are routed to AOS for processing. Inbound and outbound
messages can take advantage of message transforms or value
substitutions when they are configured to do this.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
2-1
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012The following diagram illustrates the services and
AIF architecture.
FIGURE 2.1 SERVICES AND AIF ARCHITECTURE
High Level Features and ConceptsThe process flows in Microsoft
Dynamics AX2012 are managed by integration ports, simplifying the
administration of services and the AIF. This replaces AIF endpoints
and related concepts that were used in previous releases of
Microsoft Dynamics AX. This lesson will review those high level
processes and illustrate the following flowing features and
concepts.
Synchronous and asynchronous transports
Basic and enhanced ports
Inbound and outbound message exchanges
Service types2-2
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureService operations
Service groups
Synchronous and Asynchronous TransportsAIF supports synchronous
and asynchronous transports for exchanging XML documents with
external systems. In synchronous mode, requests are tightly coupled
to responses, and the same connection is used for the request and
the response. In this case, AIF immediately processes the request
and then sends a response. In asynchronous mode, requests are sent
through a queue, called the gateway queue. Queued messages are
processed at a later time. In this case, responses are delayed, but
large volumes of messages can be processed more efficiently, and
message processing can be controlled by changing various
configuration settings.
Basic Integration PortsBasic integration ports are exposed
through a specific Windows Communication Foundation (WCF) endpoint
on the Application Object Server (AOS) host. Only a developer can
create a new basic integration port. When a developer creates a
service group in the Application Object Tree (AOT), a basic inbound
integration port is also automatically created if the autoDeploy
property is set to yes. The basic inbound integration port is then
associated with the service group. Some basic integration ports,
such as those that are used for system services, are auto deployed
and enabled by default.
Enhanced Integration PortsIf you want advanced integration
capabilities that you can use to customize the behavior of an
integration port, you must create an enhanced integration port.
Enhanced integration ports provide the following capabilities that
basic integration ports do not provide:
Services can be hosted on either AOS or Internet Information
Services (IIS).A variety of protocols are supported through WCF
adapters. These protocols include HTTP and NetTCP. Enhanced
integration ports also support a file system adapter that lets you
use file paths as addresses and a MSMQ adapter.
You can configure pre-processing and post-processing of service
requests and service responses, for instance through configurable
transformations.
You can customize service and data contracts by selecting the
set of service operations that are exposed when you create the data
policies.
You can specify advanced security and troubleshooting
settings.
Change tracking is supportedMicrosoft Official Training
Materials for Microsoft DynamicsYour use of this content is subject
to your current services agreement
2-3
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Inbound and OutboundInbound ports are used by
external systems to call Microsoft Dynamics AX AIF and services.
This kind of exchange is called an inbound exchange. For example,
during an inbound exchange, an external system can send a sales
order so that the sales order can be saved to the Microsoft
Dynamics AX database.
AIF can also be used by Microsoft Dynamics AX to call external
systems. For example purchase orders can be sent electronically to
an external system by using an outbound exchange. Some outbound
exchanges can be triggered by an
inbound message. For example, an external system might send an
inbound request for information about a specific product and
receive product information from an outbound message. This kind of
exchange is called an outbound exchange.
How Documents are ExchangedAIF provides an extensible framework
for the exchange of XML documents with external systems. The
framework supports synchronous and asynchronous transports. In
synchronous mode, requests are tightly coupled to responses. This
means that the submitter of the request must wait for a response
from AIF before proceeding. In this case, AIF immediately processes
the request and then sends a response. In asynchronous mode,
requests are placed into a queue, called the gateway queue. Queued
messages are processed at a later time and AIF sends a response
when processing is completed. In this case, responses are delayed,
but large volumes of messages can be processed more efficiently,
and message processing can be controlled by changing various
configuration settings.
AIF can be used to send data into Microsoft Dynamics AX. This
kind of exchange is called an inbound exchange. For example, during
an inbound exchange, an external system might send a sales order so
that the sales order can be saved to the Microsoft Dynamics AX
database. AIF can also be used to retrieve data from Microsoft
Dynamics AX. This kind of exchange is called an outbound exchange.
For example, during an outbound exchange, an external system might
send a request for a purchase order and receive the purchase
order.
The inbound and outbound exchanges can be categorized in the
following ways:
Send data Microsoft Dynamics AX sends documents to an external
system.
Send data in response to requests Microsoft Dynamics AX receives
requests for documents from another authorized system, and
retrieves the requested information, such as a document or a list
of documents, from the Microsoft Dynamics AX database.
Microsoft Dynamics AX then returns the information to the
requesting system, and the appropriate filtering and security are
applied. The request message contains the entity keys or a query
that specifies the data that
the external system is requesting.2-4
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureReceive and create data Microsoft
Dynamics AX receives documents from another authorized system and
creates new records in the Microsoft Dynamics AX database.
ParallelismTo improve performance for data exchange by using
asynchronous adapters, AIF supports parallelism. Parallelism
specifies that inbound messages are processed by one or more AOSs
without regard to the order in which they are received or produced.
This helps you scale out message processing by adding multiple
AOSs. Note that you can enable parallelism only for inbound
channels.
Parallel processing in AIF is implemented on a
channel-by-channel basis. Follow these steps to implement parallel
processing.
1. Click System Administration > Setup > Services and
Application Integration Framework > Inbound Port or System
Administration > Setup > Services and Application Integration
Framework > Outbound Port.
2. Select a channel and select the Process requests in parallel
check box.Conversational parallelismalso known as ordered
parallelismmeans that you can specify certain messages to be
processed sequentially in a channel, even when parallelism is
enabled for that channel. This is done by including a special XML
element called in the messages that require sequential processing.
All messages with the same ConversationId will then be processed
sequentially.
NOTE: If you do not select the Parallel processing field in the
Channels form, all inbound messages for a particular endpoint will
be processed sequentially and the element in a message is
ignored.Microsoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreement
2-5
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Service TypesMicrosoft Dynamics AX, together with
AIF, enables building integrations with other systems. By using the
programming model for Microsoft Dynamics AX services, you can
customize the document services that are included with Microsoft
Dynamics AX 2012, create new custom services. To support a range of
option for customization and programmability, Microsoft Dynamics AX
provides the following types of services:
Document Services - Services that represent data and business
logic within Microsoft Dynamics AX. You can use or customize the
over
70 standard Axd document services that are included with
Microsoft Dynamics AX. If none of the standard document services
meet your needs, you can create a new document service by using the
AIF Document Service Wizard. Each document is represented by a
class; the name of a document class is preceded by Axd. For
example, AxdSalesOrder is the name of the document and also the
name of the document class.
Custom Services - Services that you create to expose X++ logic
through a service interface. You can use the business logic with
inbound or outbound transfers.
System Services - Services that cannot be customized. The Query
Service, Metadata Service, and User Session Service are Windows
Communication Foundation (WCF) services that are included with
Microsoft Dynamics AX. They provide access to data that is returned
in queries, metadata for AOT objects such as tables and
extended
data types (EDTs), and data about the calling user such as
default language and default company.
Document Service OperationsA service operation is a named set of
functionality that is offered by a service. A service can expose
multiple service operations. The service operations that a service
exposes can include custom service operations.
For example, the sales order document services service operation
that creates a new sales order is named
SalesSalesOrderService.create. Service operations include: create,
delete, find, findkeys, getkeys, getchangedkeys, read, and
update
NOTE: When you configure an integration port, you must know
which service operations have to be exposed from the port.2-6
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureService GroupsDevelopers can group
services and service operations that are managed and consumed
together into a service group. All the services in a service group
are published through a basic port, in a single WSDL file. The WSDL
contains all service and data contracts for the service operations
of the service group, which simplifies developing the code that
consumes services.
NOTE: A Web Service Description Language (WSDL) file defines the
operations that are available for a service.Developers can create a
service group in the Application Object Tree (AOT). Developers can
use the AutoDeploy property to specify whether the service groups
that they create are automatically deployed and activated when they
are created. Developers must manually deploy and activate any
service groups that are not automatically activated.
NOTE: Service groups are associated only with basic integration
ports.TopologyThere are certain factors to consider when you plan
the topology of services and
Application Integration Framework (AIF).
AdaptersIn Microsoft Dynamics AX 2012 services and Application
Integration Framework (AIF), integration ports use adapters. These
adapters enable Microsoft Dynamics AX to communicate by using
various transport protocols.
Microsoft Dynamics AX 2012 provides the following four adapters
that represent predefined bindings:
HTTP adapter - This adapter enables synchronous exchanges
through web services on Internet Information Services (IIS), which
can expose services on a network or the Internet.
NOTE: Web Services should in general never be deployed by using
basic HTTP binding. HTTPS bindings or similar, should be selected
even for internal use. When you use the HTTP binding, all data will
travel unencrypted and can be read by anyone on the same segment on
the network.NetTCP adapter - This adapter enables synchronous
exchanges by using support for WS-* standards over the Transmission
Control Protocol (TCP) transport.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
2-7
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012MSMQ adapter - This adapter enables asynchronous
exchanges through message queues. To use this adapter, you must
install Message Queuing, which is also known as MSMQ, on a network
computer. You must also create at least one public queue to
configure the MSMQ Adapter for Microsoft Dynamics AX.
File System adapter - This adapter enables asynchronous
exchanges through file system directories. You must enable and
configure at least one file system directory, or folder, for
messages. Inbound messages and outbound messages require separate
folders.
NOTE: Microsoft Dynamics AX 2012 no longer includes a BizTalk
adapter. Earlier versions of Microsoft Dynamics AX required a
BizTalk adapter for integration with Microsoft BizTalk Server.
However, BizTalk Server can now connect to AIF through
standards-based adapters. For more information, see Exchanging
documents between BizTalk Server and AIF
(http://go.microsoft.com/fwlink/?LinkID=247431&clcid=0x409 )
and the Using Microsoft BizTalk Server 2010 to Exchange Documents
with Microsoft Dynamics AX
(http://go.microsoft.com/fwlink/?LinkID=247479&clcid=0x409
)whitepaper.Performance ImprovementsThe following list describes
enhancements in services and AIF that result in improved
performance:
To achieve scale and redundancy, you can configure AOS servers
with the Network Load Balancing (NLB) for Microsoft Dynamics AX
services. The AOS-clustering solution affects only the RPC- based
connections and does not allow you to load balance Microsoft
Dynamics AX services. For more information, refer to Configuring
network load balancing for services
(http://go.microsoft.com/fwlink/?LinkID=247480&clcid=0x409
).
Client applications can access services directly on AOS;
IIS-hosted services use the WCF routing service and no longer
depend on the
.NET Business Connector, which was required for services and
AIF
in previous releases of Microsoft Dynamics AX.
The services framework uses connection pooling to reduce the
overhead of creating and destroying a session on service calls.
When to Use IIS HostingTo consume services over the Internet,
you must host services on Internet Information Services (IIS). IIS
uses the message routing service to route all service requests to
AOS where all service requests are processed.. AOS then returns a
response to the service consumer through IIS.
Microsoft Dynamics AX deploys services that are hosted on IIS to
a subfolder of the virtual directory that is associated with the
web site that you provide.
2-8
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureUsabilityNew usability features of
services and Application Integration Framework (AIF) are added to
Microsoft Dynamics AX 2012. The following are components of the new
features.
Moving service configurations by using integration ports in
AIF
Change tracking based on date and time of changes
Templates for the transforms for Banking
Configure services for Office add-ins
Office Add-insThe new add-in for Microsoft Excel and Microsoft
Word help users to view, analyze, and update information in
Microsoft Dynamics AX. The Microsoft Excel add-in has built-in
support for consuming document services for updating data.
Excel Document Service RegistrationData in Microsoft Excel can
be modified by using any document service that has a Create or
Update service operation, and that uses a file adapter or net.tcp.
Before using a document service, you must register it, add it to an
inbound integration port, activate the port, and then expose the
service.
Only the following document services from Microsoft Dynamics AX
2012 are supported without modification in the Excel Add-in:
BudgetTransaction
EMSMeterReading
EMSSubstanceFlow
GeneralJournal
ProductionPickingList
ProjectHourJournalS
SysImportBusSector
VendGroup
VendRequestSignup
Additional services can be constructed to extend the scenarios
in which Excel can be used to update, create, and delete business
data in Microsoft Dynamics AX.
NOTE: The configuration of integration ports for Excel import is
a specific example of the procedures that are used to configure any
integration port.Microsoft Official Training Materials for
Microsoft DynamicsYour use of this content is subject to your
current services agreement
2-9
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Moving Service ConfigurationsMicrosoft Dynamics AX
2012 uses integration ports to manage integration scenarios in
services and AIF. To move service configurations from test
environments to production environments, you must meet specific
prerequisites and complete the following tasks:
Export the service metadata from the source environment, which
is the test environment. This metadata includes AOT code, service
details, and so on.Export configuration data about integration
ports from the source environment. The data is exported as a .dat
file.
Import the exported metadata into the destination environment,
which is the production environment.
Import the integration port data into the destination
environment.
Prerequisites to Export/Import Configuration DataBefore you
migrate configuration data from a test environment to a production
environment, ensure that you meet the following prerequisites:
Create a file share.
For file-based integrations, the account for the AOS must have
read/write permissions for the file share. The file share must not
be an administrative share, such as shares that contain a dollar
sign ($).
The user who is importing the port configurations into the
destination environment must have privileges as an AIF
administrator. This means that the user must have the AifAdmin
privilege.
All customizations must first be added to the source
environment, and the application must compile without errors.
All ports must be activated and tested. For ports that are based
on NetTCP and HTTP, the Web Service Description Language (WSDL)
files must be published. Additionally, a client must be able to
start
the service through service calls. For ports that are based on
the file system adapter or the MSMQ adapter, the corresponding
scenario must be tested.
2-10
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureProcedure: Export the Integration
Port Configuration DataUse the following procedure to export the
integration port configuration data.
1. Create a new definition group for exports. Click System
administration > Common > Data export/import > Definition
groups.
a.Click New.
b. Enter a unique name for the group into the Definition
groupfield.c.Optionally enter a description.
d. Click the Options tab and clear all the check boxes.
e.Click the Include table groups tab and clear all the check
boxes. f.Click OK.
2. Select tables for the definition group by clicking Select
tables.
a.Click Add, and then for inbound ports, select AifInboundPortin
the Name of table field.b. Select Include document references and
Specify related tablescheck boxes.c.Click the Select related tables
button. On the Select related tables form, select the desired
related tables to include and then click Close.
d. Optionally, add export criteria by selecting the Apply
criteria check box, and then click Export criteria. Enter the
desired filter criteria and then click OK.
e.Close the Select tables form.
3. Export the data to a local or network file share by clicking
Export to on the Definition groups form. Select the file name and
path, and then select the file type. Click OK to export the data to
the specified file.
4. Close the Definition group form.
5. Repeat steps 1 through 4, using AifOutboundPort in the Name
of table field in step 2.a instead of AifInboundPort.
NOTE: During export, you might receive the following message:
"TableDirPartyCollection was not found." If you receive this
message, add export criteria, which is described in Step 3 of the
"Export the Integration Port Data" procedure, to export only new
and customized ports.Microsoft Official Training Materials for
Microsoft DynamicsYour use of this content is subject to your
current services agreement
2-11
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Procedure: Import the Integration Port
Configuration DataIn the destination environment, use the following
steps to import the file for the integration port data that you
exported from the source environment.
1. Open the Import options form. Click System administration
> Common > Data export/import > Import.
2. If you exported only selected ports by using export criteria,
select Update existing record on the Advanced tab. Otherwise,
existing ports in the destination environment are deleted.
When you have finished importing the data, you must deactivate
the imported ports, register services, register basic ports, and
update the configuration details for each port. For example, you
would update URIs based on paths in the production environment, and
then activate the ports. For more information on completing these
steps, refer to Exporting and importing AIF integration port
configurations
(http://go.microsoft.com/fwlink/?LinkID=247481&clcid=0x409
).
NOTE: This process will need to be completed once for each
exported file in theExport the Integration Port Data
procedure.IMPORTANT: If the production environment is part of a
cluster, you must restart all AOS instances to guarantee that all
configurations are updated.Change TrackingIn Microsoft Dynamics AX
2012, you can configure the database to keep track of when changes
happen at the table level. When so configured, you can use the
getChangedKeys service operation to retrieve entity keys for only
those documents that have changed based on certain criteria, such
as a specified date and time.
Change tracking must be enabled in the database for the database
tables that are used by the document service. To do this, you will
need to configure change tracking. To retrieve the entity keys for
documents that were changed, you must publish the getChangedKeys
service operation through an integration port. Additionally, you
will need to create a document filter and add filtering
criteria.
NOTE: You can use change tracking only if the document service
is exposed through an inbound enhanced integration port.IMPORTANT:
You must create at least one document filter. Otherwise, no entity
keys are returned from the getChangedKeys service
operation.2-12
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureOnce enabled, you can use change
tracking in two ways:
Submit an XML document to AIF that specifies the getChangedKeys
action in the message header.
Call the getChangedKeys method on a document service class.
Only the entities that are changed on or after the
_changedDateTime parameter are returned.
The response message contains a list of entity keys. These keys
represent the documents that have been changed according to the
criteria that you specified, such as documents that were changed
after a certain date and time.
NOTE: For more information on configuring change tracking refer
to Configuring AIF for change tracking
(http://go.microsoft.com/fwlink/?LinkID=247482&clcid=0x409
).Templates for BankingApplication Integration Framework (AIF)
provides framework that can help you generate payment files by
using document services. This is an advantage over the previous
system where the base classes were extended and customized to
select appropriate data from transactional tables. If the
parameters changed, then there would need to be recoding. Document
services now help you to exchange data with external systems by
sending and receiving data in XML documents.
There are two primary areas of functionality in this process:
the transport components and the business logic components. The
transport components handle the transfer of business logic in and
out of the system by using XML documents. The elements of the
transport layer define how data is exchanged, including the source
of the data, the destination of the data, and how it is
transported.
The business logic component of document exchange consists of
the data, its format, and the business rules that govern the data.
This business logic is exposed by two sets of classes: the base
classes and the document service classes in the XML Document
Framework. To provide framework for current and future payment
formats, you can create a single query that exposes all the fields
that are required for all the outbound payment formats. Use the AIF
Document query wizard to generate the service and document object,
data object, and Axd document classes.
To enable payment generation by using AIF, use the customer and
vendor payment services to expose the payment generation data for
AIF outbound processing service. These services are based on
Microsoft Dynamics AX queries. Customer/Vendor payment query
captures all the necessary data to generate customer/vendor
electronic payment files. Use the AIF document service wizard to
generate the service document and data object classes. An XSLT can
be applied on this master data to transform the AIF XML file to the
payment file for a specific payment format.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
2-13
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012For every payment format that you intend to
generate by using AIF, you need to have a corresponding XSLT file.
This XSLT is based on the format that is specified by the bank.
These XSLTs can be can be created by using a simple text or XML
editor. You can also use visual studio and BizTalk mapper. For
payment files that are not XML, you need to apply an outbound
transformation to convert the XML results to flat file. Outbound
transforms can be of any type and they
post-process the generated XML file to obtain the desired
payment file.
For the Microsoft Dynamics AX administrator, he or she has
access to outbound port setup and can create an outbound port and
define payment processing data for a payment format. The
administrator can chose the outbound folder and the XSLT for the
specific payment format. For a end user, the experience is quite
similar to generating the payments by using file I/O. The user only
needs to choose payment format and the format specific data that is
required for the specific instance of payment creation process.
Generating payments by using services provides flexible and
extensible framework helps you to effortlessly easily plug and
remove payment formats. The application integration framework
provides capabilities, like outbound transforms, to help you plug
in additional XSL or binary transformations to generate the desired
payment files. In the event of any change to payment formats, the
XSLT can be modified outside of Microsoft Dynamics AX. Any new
payment formats can be added by creating the XSLT and adding it to
the outbound port.Support for Data Model ChangesIn Microsoft
Dynamics AX 2012, the services framework is enhanced to use several
of the infrastructure features that are added in Microsoft Dynamics
AX. Each document service is built on top of a query that is used
to produce the data contract for that service as a document. The
services framework handles scenarios to produce more user-friendly
data contracts. These scenarios include the following:
Replacing a surrogate foreign key with the natural key for a
specific table relationship so that the final service contract has
user-friendly readable fields instead of Surrogate Foreign Keys
(SFK).
Handling the queries that contain tables with dimension columns
in the data sources. The framework has support to serialize or
desterilize the dimension columns across the service boundary.
Understanding table inheritance.
Handling tables with date effective fields.
The create and update document service wizards have been updated
to generate code that includes the previous changes.
2-14
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureSummaryApplication Integration
Framework (AIF) helps companies integrate Microsoft Dynamics AX and
communicate with external business processes and other enterprise
applications within and outside the boundaries of the business
through the exchange of XML over various transport media.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
2-15
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Test Your KnowledgeTest your knowledge with the
following questions.
1. Which of the following can not be a basic port? ( )
Outbound
( ) Inbound
( ) Endpoint
( ) Startpoint
2. Which of the following Axd document service operations are
available in
AIF? (Select all that apply)( ) Create
( ) Read
( ) Update
( ) keysFind
3. Which of the following is not a service type? ( ) Custom
services
( ) Document services
( ) NetTCP services
( ) System services
4. Which of the following best describes synchronous and
asynchronous transports? (Select all that apply)
( ) Requests are tightly coupled to responses.
( ) Requests are placed into a queue, called the gateway queue.
( ) Invoke business logic by using preprocessing options.
( ) Requests develop new file links by using
post-processing.2-16
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 2: ArchitectureQuick Interaction: Lessons
LearnedTake a moment and write down three key points you have
learned from this chapter
1.2.3.Microsoft Official Training Materials for Microsoft
DynamicsYour use of this content is subject to your current
services agreement
2-17
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012SolutionsTest Your Knowledge1. Which of the
following can not be a basic port? () Outbound
( ) Inbound( ) Endpoint
( ) Startpoint
2. Which of the following Axd document service operations are
available in
AIF? (Select all that apply)() Create () Read () Update
() keysFind
3. Which of the following is not a service type? ( ) Custom
services
( ) Document services
() NetTCP services
( ) System services
4. Which of the following best describes synchronous and
asynchronous transports? (Select all that apply)
() Requests are tightly coupled to responses.
() Requests are placed into a queue, called the gateway queue. (
) Invoke business logic by using preprocessing options.
( ) Requests develop new file links by using
post-processing.2-18
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 3: Installation and UpgradeCHAPTER 3: INSTALLATION
AND UPGRADEObjectivesThe objectives are:Introduction
Discuss the installation process and the special considerations
for
Services and AIF in Microsoft Dynamics AX 2012.Review the
upgrade considerations for Services and AIF.
Knowing the installation and upgrade considerations for Services
and Application Integration Framework (AIF) in Microsoft Dynamics
AX 2012 is critical for successful implementation.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
3-1
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012InstallationInstallation and configuration of
Services and AIF has changed. In Microsoft Dynamics AX 2012, the
Application Object Server (AOS) is the Windows Communication
Foundation (WCF) service host for Microsoft Dynamics AX services,
and web services on IIS is an optional component. Additionally, the
BizTalk adapter has been depreciated in favor of using the Windows
Communication Framework (WCF)-based adapters that are included with
BizTalk.
IISInstalling Microsoft Dynamics AX web services on IIS is
optional. The Application Object Server (AOS) is the Windows
Communication Foundation (WCF) service host for Microsoft Dynamics
AX services that are available to users and applications across an
intranet. To make Microsoft Dynamics AX services available over the
Internet, you must host them on Internet Information Services
(IIS).
If you do not need to expose the Microsoft Dynamics AX services
over the Internet or need any of the additional bindings that IIS
provides, you do not need to install services on IIS.
Before Installing Web Services on IISVerify that the following
steps are completed before you install the Microsoft
Dynamics AX web services on IIS:
On the computer where you will install the web services, run the
prerequisite validation utility to verify that system requirements
have been met.
NOTE: For more information on the prerequisite validation
utility refer to the Microsoft Dynamics AX 2012 Installation Guide
(http://go.microsoft.com/fwlink/?LinkID=247483&clcid=0x409
).Create a domain account that will be used as the Business
Connector proxy account. This account might also be the one that is
used for reporting service accounts and for the IIS Application
pool identity. Each account that must run as a service requires the
following properties:
oBe a dedicated account (used only for the specific purpose)
oHave a password that does not expire
oHave minimal access to network resources
oBe able to log on as a service3-2
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 3: Installation and UpgradeMake sure that you have
the required permissions to install the web services, which
requires you to be a member of the following:
oThe Administrators group on the local computer where you are
installing Web Services on IIS
oThe System administrator role in Microsoft Dynamics AX 2012
CAUTION: Do not install web services on IIS on a server that is
a network domain controller.Procedure: Install the Web Server (IIS)
RoleWhen you run the prerequisite validation utility it presents
the option to configure the Web Server role. However, the
prerequisite validation utility does not install the ASP.NET role
service. Use the following steps to install the ASP.NET role
service:
Start the Server Manager. Expand the Server Manager
(computer_name) node. Right-click Web Server (IIS) and then click
Add Role Services.
On the Select Role Services dialog, expand the Web Server
(Installed) > Application Development (Installed) node and then
select ASP.NET. Click Next and go through the wizard pages.
Restart the server.
NOTE: This procedure has already been completed in the Hyper-V
image.Procedure: Create an IIS WebsiteCreate a website that Setup
will use to install the Microsoft Dynamics AX web services. You can
create a new website or use an existing one, such as the
Default Web Site on IIS. If you install the Microsoft Dynamics
AX web services on an IIS that also hosts a SharePoint web front
end or other web services, be sure to avoid port-binding
conflicts.
Procedure: Install Web Services on IISUse the following steps to
install web services on IIS:
1. Double-click D:\Setup.exe.
2. Under Install, click Microsoft Dynamics AX components.
3. If the setup support files have not yet been installed on
this computer, the Select a file location page is displayed. The
Setup support files are required for installation. Provide a file
location or accept the default location and then click Next. On the
Ready to install page, click Install.
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreement
3-3
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012NOTE: In the Hyper-V image, setup install files
have already been installed.4. Click Next.
5. In the Modify Microsoft Dynamics AX installation page,
click
Add or modify components, and then click Next.
6. On the Add or modify components page, select Web services
onIIS and then click Next.7. On the Prerequisite validation page,
resolve any errors. When no errors remain, click Next.
8. On the Specify Business Connector proxy account
informationpage, enter the password for the proxy account that is
used by the
.NET Business Connector. Click Next.
NOTE: The proxy account for the .NET Business Connector in the
Hyper-Vimage is "CONTOSO\SQLService" and the password is
"Pa$$w0rd".9. On the Configure IIS for Web services page, accept
default values or provide information for the website, application
pool, and virtual directory. Setup will create a virtual directory
and an application
pool for the Microsoft Dynamics AX web services under the
selected website. The application pool will run as the .NET
Business Connector proxy user that you entered in the previous
step.
IMPORTANT: You must restart IIS after Setup installs the web
services. SelectRestart IIS after installation is complete to
automatically restart IIS.10. Click Next to continue.
11. On the Specify an AOS account page, provide the service
accounts for the AOS instances that you will use with web services
on IIS. Click Next to continue.
12. On the Prerequisite validation results page, resolve any
errors.
When no errors remain, click Next.13. On the Ready to install
page, click Install.
14. After the installation is complete, click Finish to close
the wizard.
Procedure: Configure IISFor IIS 7, use the following steps to
configure the application pool that is associated with the
Microsoft Dynamics AX 2012 web services for IIS 7. This step is
required to set the correct version of the .NET Framework.
1. Click Start > Administrative Tools > Internet
InformationServices (IIS) Manager.2. Click SEA-DEV > Application
Pools.3-4
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 3: Installation and Upgrade3. In the Application
Pools pane, right-click MicrosoftDynamicsAXAif60 application pool,
and click Basic Settings.
4. In the Edit Application Pool dialog box, select .NET
Framework
4.0 or a later version, such as V4.0.30319. Select Integrated
from the Managed pipeline mode list. Notice that the Start
application pool immediately option is selected. Click OK to return
to IIS Manager.
5. Click SEA-DEV .
6. Right-click SEA-DEV and then click Stop.
7. Right-click SEA-DEV and then click Start.
For IIS 6, make sure that the virtual directory for the
Microsoft Dynamics AX web services is associated with version 4 of
.NET Framework. Refer to IIS 6.0 documentation for
instructions.
Procedure: Register the Website in Microsoft DynamicsAX 2012Use
the following steps to register the website in Microsoft Dynamics
AX.
1. Open Microsoft Dynamics AX 2012.
2. Click System administration > Setup > Services and
ApplicationIntegration Framework > Web sites.
3. On the Web sites form, create a new record and provide
appropriate values for the Name, Virtual directory share path,
Description, and URL fields.
NOTE: On the Hyper-V image a record will already be created with
the following URL and virtual directory share path.URL:
http://sea-dev:8080/MicrosoftDynamicsAXAif60Virtual directory share
path: \\SEA-DEV\MicrosoftDynamicsAXAif60 (file://sea-
dev/MicrosoftDynamicsAXAif60)4. Click Validate. Verify that the
Infolog dialog confirms that the website is configured properly,
and that you can access the computer and the website.
NOTE: When you install web services on IIS, a record for the new
website is added to AifWebsites table. If you uninstall web
services on IIS, this record is not deleted from the table. This
record can cause a warning to be displayed if you reinstall web
services on IIS. You can manually delete the record from the
AifWebsites table or simply ignore the warning.Microsoft Official
Training Materials for Microsoft DynamicsYour use of this content
is subject to your current services agreement
3-5
Application Integration Framework and Services inMicrosoft
Dynamics AX 2012Creating Additional Web SitesYou can create
additional websites if you require them. For example, you might
have to expose a web service through a web server that is installed
on a different computer than the instance of Application Object
Server (AOS).
When adding a website, consider the following:
You must set the appropriate permissions for a new virtual
directory so that Microsoft Dynamics AX can access the file share.
The group that is named Microsoft Dynamics AX Web Service
Administrators must have full access to the new virtual directory
and file share.
If this group does not exist as a local group on the new
computer, you must create it. You must then add, as a user, the
domain account for all AOS instances that require access. For these
changes to take effect, you must restart all AOS instances that you
added to the group.
When you install web services on IIS, a record for the new
website is added to the AifWebsites table. If you uninstall Web
services on IIS, this record is not deleted from the table. Because
this record still exists, you might receive a warning if you later
reinstall Web
services on IIS. You can either manually delete the record from
the
AifWebsites table or ignore the warning.
MSMQMicrosoft Message Queuing (MSMQ) is a technology that
enables applications that are running at different times to
communicate across heterogeneous networks and systems that might be
temporarily offline. MSMQ provides guaranteed message delivery,
efficient routing, security, and priority-based messaging. It can
be used to implement solutions for asynchronous and synchronous
messaging scenarios.
To send documents by using Message Queuing, you must install it
on a computer on the network and create at least one public
queue.
To receive documents by using Message Queuing, you must install
Message
Queuing and create at least one queue.
MSMQ LimitationsMessages that are processed by the MSMQ adapter
have a size limit of 4 megabytes (MB). For this reason, we do not
recommend using Message Queuing to import data in bulk, such as by
using the AIF batched-message schema.
3-6
Microsoft Official Training Materials for Microsoft DynamicsYour
use of this content is subject to your current services
agreementChapter 3: Installation and UpgradeInstalling MSMQAny
computer that communicates through Message Queuing, including
computers that run AOS, must have Message Queuing installed.
Windows servers must have the Application Server role added. For
application servers, select the following options:
Incoming Remote Transactions
Outgoing Remote Transactions
Windows servers must have the Application Server Features added.
For Message
Queuing > Message Queuing Services, select the following
options:
Message Queuing Server
Directory Service Integration
HTTP Suppor