Sie sind auf Seite 1von 18

Chapter 1: Introduction to Services and Application Integration Framework

CHAPTER 1: INTRODUCTION TO SERVICES AND


APPLICATION INTEGRATION FRAMEWORK
Objectives
The objectives are:

List the high-level features of Services and Application Integration


Framework (AIF).

Discuss integration planning and options.

Introduction
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.

1-1

Application Integration Framework and Services in


Microsoft Dynamics AX 2012
Services and the Application Integration Framework
In 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.
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.

Concepts
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.

1-2

Feature

Description

Application Integration
Framework

The 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.

Chapter 1: Introduction to Services and Application Integration Framework


Feature

Description

Services

Application 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 operations

Service operations are the capabilities that are


offered by a service, and include:
create

Service groups

delete

find

findKeys

getKeys

getChangedKeys

read

update

A 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.

1-3

Application Integration Framework and Services in


Microsoft Dynamics AX 2012
Feature

Description

Integration ports

In 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

Adapters

1-4

Enhanced Inbound Port

Enhanced Outbound Port

In 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

Messages

In 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.

Schemas

AIF 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.

Chapter 1: Introduction to Services and Application Integration Framework


Feature

Description

Transforms

To 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 Services
In 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 Configuration


In 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.

1-5

Application Integration Framework and Services in


Microsoft Dynamics AX 2012
Change

Description

Services hosted on
the AOS

The 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
Connector

In 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 groups

The AutoDeploy property on service groups allows


these groups to be deployed without administrator
interaction.

First Class Programming Model


Some 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 Standards


Microsoft 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

Chapter 1: Introduction to Services and Application Integration Framework


New Features
Services and AIF for Microsoft Dynamics AX 2012 include feature
improvements, which are shown in the following table.
Feature

Description

Service groups

With service groups, a developer can group related


services together.

Integration ports

Integration ports provide a simple interface to control


data that is going into and coming out of services and
AIF.

Support for nonXML files

Data that is not XML, for example, a comma-delimited


file, can now be imported into and exported from
Microsoft Dynamics AX.

Batched
messaging

In 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 tracking

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.

Performance
improved

Several improvements were made to enhance the


overall performance of services and AIF in Microsoft
Dynamics AX 2012.

Security

Microsoft 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
troubleshooting

A 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.

1-7

Application Integration Framework and Services in


Microsoft Dynamics AX 2012
Feature

Description

Support data
model changes

The document services framework supports the data


model changes that are implemented in Microsoft
Dynamics AX 2012.

Performance Enhancements
The 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 RPCbased 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.

Architecture
Microsoft 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

Chapter 1: Introduction to Services and Application Integration Framework


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.

Integrations
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 Services


Integrations 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 Types
To 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.

1-9

Application Integration Framework and Services in


Microsoft Dynamics AX 2012

Document 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 Planning
Planning 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.

1-10

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.

Chapter 1: Introduction to Services and Application Integration Framework


Before integrations are created, we recommend that the implementation team
consider the questions that are described in the following table.
Question

Effect 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.

1-11

Application Integration Framework and Services in


Microsoft Dynamics AX 2012
Question

Effect on the Design

What is the availability of the


systems that are being integrated?
What are the requirements for realtime 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 Process


Typical 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:
o The data that must be exchanged
o Any business logic that is related to that data
o The external systems with which data must be exchanged
o The conditions under which data is sent from or received by
Microsoft Dynamics AX
2. 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

Chapter 1: Introduction to Services and Application Integration Framework


The 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 Required
The 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)

1-13

Application Integration Framework and Services in


Microsoft Dynamics AX 2012

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

Summary
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:

1-14

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 tracking

Chapter 1: Introduction to Services and Application Integration Framework

Test Your Knowledge


Test 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 commadelimited 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
( ) Services

1-15

Application Integration Framework and Services in


Microsoft Dynamics AX 2012

Quick Interaction: Lessons Learned


Take a moment and write down three key points you have learned from this
chapter
1.

2.

3.

1-16

Chapter 1: Introduction to Services and Application Integration Framework

Solutions
Test Your Knowledge
1. 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 commadelimited 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
() Services

1-17

Application Integration Framework and Services in


Microsoft Dynamics AX 2012

1-18

Das könnte Ihnen auch gefallen