Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
In Microsoft Dynamics AX 2012, improvements to the Services and Application
Integration Framework (AIF) allow for easier creation and deployment of
Services and align Microsoft Dynamics AX Services with industry standards for
web services. Microsoft Dynamics AX 2012 introduces integration ports for
streamlined deployment of the Services and AIF and provides several benefits to
system administrators through the following features and improvements:
Integration ports
5-1
Services
All Microsoft Dynamics AX services are Windows Communication Foundation
(WCF) based services that clients can use to interact with and retrieve system
information. In Microsoft Dynamics AX 2012 the following three service types
are supported:
Document services
Custom services
System services
Document Services
In Microsoft Dynamics AX 2012, the services framework is improved to use
several of the infrastructure features 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. The services framework handles scenarios to produce a
usable data contract schema. These scenarios are described in the following list:
Table Inheritance
Date Effectivity
Custom Services
AIF in Microsoft Dynamics AX 2012 aligns itself more with the .NET vision of
creating services, in the sense that classes are marked with attributes that define
service contracts, data contracts, and data members. Service contracts describe
the methods that you want exposed to the end-user. Data contracts declare the
data structure that an end-user must comply with, to exchange data with your
service. Data members are the individual fields that comprise your data contract.
An AIF service is a Microsoft Dynamics AX class that has some special
attributes added before the method declaration. These attributes tell Microsoft
Dynamics AX which class methods that you want to expose as service contracts.
Microsoft Dynamics AX classes exposed as services are declared public and
must be registered in the AOT services node.
Data contracts are typical Microsoft Dynamics AX classes decorated with the
[DataContractAttribute] attribute. Data members inside the class must be
decorated with the [DataMemberAttribute] attribute.
5-2
Metadata service: You can use this to query for the metadata in
your system. You can retrieve metadata for labels, menus, tables,
extended data types, data types, enums, queries, web menus,
information parts, and services. The metadata service should be used
when you want to return information about the structures in
Microsoft Dynamics AX to a client application. For example, if you
wanted to return information about a table such as what indexes exist
on that table, you can use the metadata service.
Query service: You can use this to issue a query for data without
using an AIF document service or creating a custom service. The
query service returns data in an ADO.net dataset and implements a
paging mechanism so that you can manage queries that return large
amounts of data. When you call the query service, you can specify
the query to run in one of three ways:
o
o
o
User Session service: You can use this so that a client can read
configuration properties for the current user like configured
language, default company and default currency.
Service Groups
With services you can expose business logic that is written in X++ as a service to
be consumed by other applications. The introduction of a service group to the
AOT helps to make the management of services easier. In earlier Microsoft
Dynamics AX releases services are managed at an individual service level. The
service group is a collection of services that are frequently consumed and
managed together. All services in a service group are published in a single Web
Services Definition Language (WSDL). You only have to add a reference to a
single WSDL to gain access to the service proxies of all the services in that
service group. Service groups activate type sharing for types that are common
across various services in a service group. For example, if two services within the
same service group take a parameter of type Address, that type is shared between
the two and can be seamlessly passed between the two services.
5-3
5-4
5-5
5-6
5-7
5-8
5-9
5-10
Architecture
Windows Communication Foundation (WCF) Adapter
This release of Microsoft Dynamics AX provides expanded support for WCF
beyond the basic HTTP and HTTPS bindings. The proprietary Microsoft
Message Queuing (MSMQ) and BizTalk Server adapters provided in the earlier
releases of Microsoft Dynamics AX are removed. Microsoft Dynamics AX 2012
provides equivalent functionality through the native WCF functionality.
NOTE: Custom adapters developed by customers and partners using the AIF
adapter framework remain supported in this release.
5-11
Data Contract
Microsoft Dynamics AX supports the use of .NET and X++ types as data
contracts for service operation input and return parameters. You can pass
complex data types without having to explicitly implement XML serialization
and deserialization from them. The data contract serialization and deserialization
is now handled by Windows Communication Foundation (WCF). X++ provides
support for data contract functionality through the DataContractAttribute and
DataMemberAttributeattributes. Any .NET type that is serializable by WCF can
be used as a parameter or return type by a service in Microsoft Dynamics AX
2012.
NOTE: By default, WCF uses the DataContractSerializer to serialize and
deserialized data.
Installation Considerations
In Microsoft Dynamics AX 2012, the Windows Communication Foundation
creates a dynamic WSDL based on the service contract for each service group or
integration port. With appropriate planning, you can have a single WSDL to
expose all the necessary services that are required for a specific integration
scenario.
5-12
You must recompile and test all interfaces that used the earlier
release of Microsoft Dynamics AX to work with services in
Microsoft Dynamics AX 2012.
Security
Microsoft Dynamics AX 2012 services rely on Windows Communication
Foundation (WCF) for 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. A service operation performs a
specific action on a document such as read, update, or delete. All service
operations are performed in the context of a valid Microsoft Dynamics AX user.
When the AOS receives a service call, the services framework retrieves the
Windows identity by using the ServiceSecurityContext class. This Windows
identity is used to initialize a valid Microsoft Dynamics AX session. This
Microsoft Dynamics AX session is used for all X++ operations and is released
when the call is completed.
Each service operation causes a Microsoft Dynamics AX logon and logoff.
Microsoft Dynamics AX uses session pooling to reduce the overhead of creating
and destroying a session on every call. By default, all external WCF service calls
are made in the context of the Microsoft Dynamics AX identity of the caller.
WCF allows for client credentials to be specified in WCF configuration or in the
code. Configuration based credentials (such as certificates) can be specified in
the WCF client configuration for the service.
Some client credential values cannot be set using the WCF configuration file,
such as the user name and password or the Windows user name and password.
Such credential values must be specified in the code.
5-13
Summary
In this chapter you learned how Microsoft Dynamics AX 2012 improvements to
services and the Application Integration Framework (AIF) simplify
implementation, administration, and deployment of services and align Microsoft
Dynamics AX services with industry standards for web services. Microsoft
Dynamics AX 2012 introduces integration ports for streamlined configuration of
services and the AIF and provides several benefits to system administrators
through the following features and enhancements.
5-14
Integration ports
5-15
5-16
2.
3.
5-17
Solutions
Test Your Knowledge
1. Which of the following concepts includes the concept AIF endpoints and
related configuration forms in earlier releases of Microsoft Dynamics AX?
( ) SOAP Header
( ) Service Groups
() Integration Ports
( ) Windows Communication Foundation (WCF) Adapter
2. Which framework is recommended instead of the RunBase framework and
you can use to execute business operations synchronously or
asynchronously?
() Business Operation Framework (BOF)
( ) Windows Communication Foundation (WCF)
( ) Document Schemas (XSDs)
( ) Application Object Server (AOS)
3. Which of the following concepts is recommended instead of the Microsoft
Message Queuing (MSMQ) and BizTalk Server adapters in Microsoft
Dynamics AX 2012?
( ) SOAP headers
() Windows Communication Foundation (WCF) Adapter
( ) Inbound Port Transformer
( ) Data contracts
4. Which of the following improvements affect the system administrators?
(Select all that apply)
() Configuration is not company specific
() Integration port
() Data policies are optional
( ) Surrogate Foreign Keys (SFK)
5-18