Monday, April 16, 2012

Discovering Myself Again ... Thoughts on Past Mistakes

Hi there,

It’s been a long time since I posted something in my blog. The reason for it is because I went through a rough experience at my job. And there are a few things I would like to share with you about it.

There is no doubt that when working in projects that are challenging we can become someone else. The long nights of work, hard deadlines, personality conflicts, and stress can suck the soul out of us before we can say “A monkey stole my banana”.

In addition, because we want our projects to be successful, and want the customer to get a high quality work from us, we take it personally and we are willing to do whatever it takes to make it work.

Now, let’s add a layer of difficulty to our willingness to make something work. What about if you have a PM does not know what he/she is doing? How do we make it work then? Further, what about if because of this PM your reputation is being put to the test? And, what about if the PM is not willing to see that he/she is not doing a logical and high quality work that is fair to the customer?

In our profession we are always going to deal with this kind of scenarios. Personally speaking, the way to overcome such turmoil and frustration is actually doing some soul searching and following some basic business rules.

Do some soul searching? What do I mean by this? Well, I got to a place where I felt I wasn’t really enjoying my job anymore. Wow! This was a hard realization as I do love what I do, AX is my passion and it was getting lost in dark and negative thoughts.

I decided to take what happened to me as an opportunity to grow. Yes, to grow in spirit and AX as well. I started reading some good literature about recognizing who we really are, to then accept other as who they are. Moreover, I also realize that instead of fighting and/or trying to prove someone wrong is a bad thing that will not take us anywhere, and that it is much more productive (and humane) to let-go and try to help.

Also, even though I have work in team environments for many years, I suddenly became aware of the importance of being a good, positive and caring team member. This is a key factor to a successful career and human relationships that I forgot. What how can we help someone that is stubborn and blind? The answer for me is patience and positive actions. If we make the choice to think positively, good things happen around us. For example, it is really easy to criticize someone’s work, but it really hard to help them do a better job. Why? Because helping someone do a better job is a real challenge that only a few can do well. Only the few that really care about the wellbeing of a team can make a positive impression. Personally, I lost that touch in between my latest success and my ego.  I have made the choice to be one those few.

So, I also mentioned that we can also follow some basic business rules. The biggest mistake I’ve made in my life has been to comment on the poor PM’s performance to a customer. Now, this is tricky, what about if the customer mentions that they think your PM sucks, and you agree? Well, this is dangerous as it can get you in a lot of trouble with your employer, PM and customer in the long run. So, always follow the chain of command and never, ever share your personal opinion about someone you work with to a customer.

I’m sorry if this post is not about something technical, or a new AX discovery, but I thought it would be good to share this experience with you as I truly think that a positive and caring attitude can make the difference between a great, clean and successful AX implementation, rather than a poor and unsuccessful one.

As AX Developer/Architects, we have a clear mission, which is to provide the best of us to our customers and help them achieve their vision on time, on budget and drama-free.

Take care!

Friday, March 16, 2012

The power of Microsoft SQL Server 2012 and Microsoft Dynamics AX 2012



Hi there!

SQL Server 2012, as it's now known, is currently available as an RC, and it's expected to become available during the first half of 2012 in three versions: Enterprise, Business Intelligence and Standard.

Further, Microsoft has advertized a new feature in SQL Server 2012 called Always On, which is a tool for disaster recovery and high-availability features in SQL Server.

In addition, Always On  will allow users to experience clear scales of reporting and backup workloads, and it will also provide support for FileTable and FILESTREAM, which brings first-class high-availability to complex data types.

Another new feature is the ability to create the so-called availability groups, or groups of databases to which users can assign failovers to move.

From the article:

"Microsoft Dynamics AX 2012 can be configured to work with SQL Server AlwaysOn Availability Groups. SQL Server AlwaysOn enhances the capabilities of Database Mirroring, helps ensure availability of application databases, provides an integrated set of options including automatic and manual failover of a group of databases and simplifies deployment of high availability using integrated configuration wizard. A Microsoft Dynamics AX 2012 instance that is configured against a SQL Server AlwaysOn Availability Group can provide high availability and failover capabilities like many other applications that are built on SQL Server AlwaysOn technology. "

You can access the article HERE

That's all of now. Have a great Weekend!



Thursday, March 15, 2012

Security For Developers - Part II - Code Access Security

 

As promised, this is the second portion on Security for Developers. If you missed the first part of this series, you can get it HERE.

Today we are going to learn about code access security in Microsoft Dynamics AX 2012. And to start I would like to talk about a little bit about code access security in C#.

In C# (.NET) as well as in AX 2012, we work with security demands. And what is a security demand?

We can probably figure that demands are used to ensure that every caller who calls your code (directly or indirectly) has been granted the demanded permission.

 In a regular environment this happens when demanded for permission; the runtime's security system walks the call stack, by comparing the granted permissions of each caller to the permission being demanded. At this point, like in any high security building in New York City, if any caller in the call stack is found without the demanded permission then a SecurityException is thrown.  In the case of a New York City building, you will be thrown out of the building. Simple ah?

 Well, the same type of process exists in AX 2012 as AX 2012 Code Access Security is used by developers to protect Secured APIs from being invoked by un-trusted code (code that does not originate from the AOT). Code access security does this by verifying the following:

  1. The code asserted the appropriate permission on the call stack to use the secured class.
  2. The assert (the request to use the secured class) is executed in trusted code and saved in the AOT.
  3. The assert is executed on the same tier as the secured class.
In addition, Code Access Security covers the use of secured classes on the server tier only and we don’t need to modify client callas of secured classes, which is cool and scalable.

So here is how this works:
  1. Code Access Security must be implemented by the secured class owner and all consumers of the secured class.
  2. The owner secures the secured class by implementing a specific type of permission class and calling the demand()  (remember the C# demands above?) method on that class.
  3. Each class consumer must explicitly request permission to invoke a secured class by calling the assert() method on the permission class.  (this is where the permissions are compared)
  4. Application code will break unless both of these steps are completed. (This is similar to the  SecurityException in .NET)

NOTE: Code Access Security does not guarantee the validity of any data or parameters passed to the secured class. Data validation is still the responsibility of the consumer. 

Now, in AX 2012, there are six groups of protected classes in AX 2012 Code Access Security:
  • Direct SQL
  • Run-time compilation and execution of X++
  • Data-controlled execution of X++
  • File handling
  • Win32 Interop
  • Windows API
The follow first code shows how to consume the TextBuffer class. So, we first need to create a new FileIOPermission object, then pass the file name as a parameter, and then we call the assert() method. The second example shows how to call a CAS-enabled API.

server void MyServerFunction()
{

  // Declare the code access security permission object.
  FileIOPermission fileIOPermission;
  TextBuffer txtb = new TextBuffer();
  Filename filename ="c:\\temp\\myfile.txt";

  // Assert that it is okay to read and write files
  fileIOPermission = new   FileIOPermission(filename, 'rw');
  fileIOPermission.assert();


  // From file will demand CAS permission (read)
  txtb.fromFile(filename); // Read text from file

  // To clipboard will demand CAS permission (write)
  txtb.toClipboard(); // Copy it to the clipboard

  // To file will demand CAS permission (write)
  txtb.toFile(filename); // Write text to file
}



server void callCASEnabledAPI()
{

    DictClass dictClass;
    anytype   retVal;
    str       resultOutput;

    // Variable for the permission class.
    ExecutePermission perm;
    ;


    perm = new ExecutePermission();

    // Grants permission to execute the DictClass.callObject method.
    // DictClass.callObject is protected by code access security.

    perm.assert();
    dictClass = new DictClass(classidget(infolog));

    if (dictClass != null)

    {
        retVal       = dictClass.callObject("toString", infolog);
        resultOutput = strfmt("Return value of is %1", retVal);
        print resultOutput;
        pause;
   }

                // Closes the code access permission scope.
                CodeAccessPermission::revertAssert();
}


In the above example, if permission to use the API is not asserted, the following error is generated:
Request for the permission of type '%1' failed.
 
The following, and sadly, the last example shows how to execute permissions to a direct SQL statement within X++.

static void getCustomersDirectSQL(Args _args)
{

  Connection   userConnection;
  Statement    stmt;
  str     sqlString;
  ;

  userConnection = new Connection();
  stmt = userConnection.createStatement();

  sqlString = 'select * from custTable';

  new SqlStatementExecutePermission(sqlString).assert();
  stmt.executeQuery(sqlString);
  CodeAccessPermission::revertAssert();

}


It is important to remember that these tools are critical when developing our modifications to the system (AX 2012). Now that AX 2012 X++ language is compiled in the IL, we need to take advantage of the .NET CLR code access security when integration internal/external applications with AX 2012.

I hope you enjoyed reading this post and stay tune for my last post of this series about display methods authorizations in AX 2012.

Have a great and safe weekend!


Thursday, March 8, 2012

AX 2012 - Security for Developers - Part I



Hi there!

Roles, duties and privileges security levels cover access to single elements, for example forms, and groups of elements needed to perform a duty. As developers we are responsible for defining more granular security levels by setting access on tables and controls in a form, and/or by associating classes that perform an action with permission (i.e. an action menu item)
In this article I would like to discuss, in detail, form permissions, code access permissions and how to create security policies using the extensible data security (XDS) method.

Form Permissions
Each form in the Application Object Tree (AOT) has a permissions node. It contains either four or five sub-nodes - Read, Update, Create, Delete and Correct. Now, correct is only displayed if a table in the form has Date Effective data.

Further, under the above nodes are four additional nodes - Controls, Tables, Server Methods and Associated Forms. When we add a table to a form data source, this table is automatically added to the Tables node for each of the Permissions sub-nodes.  In addition, each of the nodes under the Tables node has an EffectiveAccess property which sets what access is allowed to the table and the EffectiveAccess property is automatically set based on properties on the data source.  

So, this is where all makes sense, if the data source property AllowDelete is set to No, the EffectiveAccess property is set to Update. If the data source property AllowEdit is set to No, the EffectiveAccess property is set to Read.

NOTE: To set the security access for a form control, we need to set the Securable property on the control to Yes. Then, this control can then be added to the Controls node under each of the permissions nodes.



Code Permissions 
These are a set of custom permissions that are created manually in the AOT under Security > Code Permissions.
For example, action menu items, can use these by setting the LinkedPermissionType property to CodePermission and the LinkedPermissionObject to the name of the code permission. Now, the great benefit about code permissions is that it can be extended to Service operations as well. This can be done by setting the Code Permission property under the Service operation > Operation method > Permissions > Associated Code Permissions node.

The following image depicts an access to post a Free-Text Invoice

Security policies - Developing an XDS Policy 
The following walkthrough will show how to create a security policy that limits users from viewing other user’s prospects. This can be seen a lot in a sales environment, where one sales person does not want the other to see his/her prospects, well who wouldn’t?

So for this example, we are going to use the smmBusRelTable where leads can hopefully become the future buyers of our products.
A lead/prospect is stored in smmBusRelTable, and the employee who is responsible for the prospect is stored in the MainContactWorker field.  In AX 2012, an employee is connected to the current user through the DirPerson and DirPersonUser tables.
There are two stages in creating the XDS policy:
1-      Create the policy query.
2-      Create the security policy.

Creating a Policy Query 
The steps to create the policy query are as follows:
  1. In the AOT, create a new query, rename it to HcmWorkerUser.
  2. From a second AOT, locate the table Data Dictionary > Tables >  HcmWorker. Drag the table HcmWorker to the Data Sources node of the query.
  3. In the property sheet of the Fields node of the HcmWorker_1 data source, set the Dynamic property to Yes.
  4. From the second AOT (Press CTRL + D to open a new AOT), locate the table Data Dictionary > Tables > DirPerson.
  5. Drag the table DirPerson to the Data Sources node of the HcmWorker_1 data source.
  6. In the property sheet for the DirPerson_1 data source, set the Relations property to Yes.
  7. In the property sheet for the Fields node of the DirPerson_1 data source, set the Dynamic property to Yes.
  8. From the second AOT, drag the table DirPersonUser to the Data Sources node of the DirPerson_1 data source.
  9. In the property sheet for the DirPersonUser_1 data source, set the Relations property to Yes.
  10. In the property sheet for the Fields node of the DirPersonUser_1 data source, set the Dynamic property to Yes.
  11. Right-click the Ranges node of the DirPersonUser_1 data source, and select New Range.
  12. In the property sheet for the new range, set the Field property to User, and the Value property to (currentUserId()) as it appears.
  13. Save your changes to the query.


Creating a Security Policy 

Follow these steps to create the security policy:
  1. In the AOT, expand the Security node.
  2. Right-click the Policies node and select New Security Policy.
  3. In the property sheet for the security policy, set the Name property to SmmBusRelUser, set the Label property to Limit Prospects by User, set the Primary Table property to HcmWorker, set the Query property to HcmWorkerUser, set the ContextType property to RoleName, set the RoleName property to TradeSalesRepresentative, and set the Enabled property to Yes.
  4. Expand the SmmBusRelUser security policy.
  5. Right-click the Constrained Tables node and select New > Add table by relation.
  6. In the property sheet for the new constrained table, set the Table property to smmBusRelTable, set the TableRelation property to MainContactWorker. Save your changes to the policy.

Now, if you were to login with the name of a sales person, you could see that you will only have access (view) your prospects because when creating the policy query we set the currentUserId() to the value of the query range.  Also, because a user is related in DirPerson and DirPersonUser tables, the policy is able to associate the user id with records in the smmBusRelTable.

That is all for now, and stay tune for the next series of security for developers as I will go in detail on consuming a secured class and setting authorization for display methods.

Until then!



Saturday, March 3, 2012

Implementing the Account and Financial Dimensions Framework for Microsoft Dynamics AX 2012 Applications

Hi there!

As you probably already know, in AX 2012, the account and financial dimensions framework has been modified from its previous version (AX 2009). It is really interesting to see an evolution in the financial dimensions framework since AX 2009.

Let's go back a little bit. In AX 2009, a ledger account was represented by a single string value and was considered to be separate from the financial dimensions. In addition, Ledger accounts were stored in the LedgerTable table.

For example, financial dimensions. (Financial dimensions were referenced as an array of up to 10 array elements that each held the string value of a foreign key to the Dimensions table. All financial dimension values were stored in the Dimensions table.)

Based on my recent research, Microsoft has dramatically enhanced the account and financial framework to provide substantially more functionality. Further, to support this new functionality, the data model has also been completely redesigned. Ok, sounds great and impressive but what does this means for us?

Well, our job is about to get more interesting. Why? Because...

  1. We will need to update every reference to ledger accounts and financial dimensions in existing applications to reference the new data model.
  2.  
  3. Each of the account and financial dimensions patterns has a corresponding AX form control.
  4. Form controls provide a consistent implementation of the functionality across the application and a simplified programming model for the framework.
  5. Account form controls combine the Segmented Entry control and a controller class. Further. the Segmented Entry control is a general-purpose Microsoft Dynamics AX client control that is being introduced in AX 2012.
  6. The controller class is an X++ class that handles the events raised by the Segmented Entry control.
  7. The combination of a control and an underlying class allows the user to see a dynamic number of segments, based on the values the user provides.

This is indeed a great opportunity for us to keep learning, adjusting and evolving around this new changes. However, this opportunity comes with great challenges, lots of study, and practice. Well, let's not be too worried about it as AX 2012 still has ledger accounts and financial dimensions, but the definition of these terms has changed slightly to account for the new functionality.

Anyhow, there is great white paper that goes over all the new changes in great detail. You can download the white paper here

Take care!

Friday, March 2, 2012

White papers for AX 2012 System Administrators

Hi,

The following link will direct you to a bunch of links that will provide information about recommended practices for system administrators who implement and manage Microsoft Dynamics AX 2012.

You can access it from HERE

Take Care!

Tuesday, February 14, 2012

Dynamics Ax 2012 – AIF Import CSV File

Hi there!

While searching for an answer on weather some file data could be imported into AX 2012 via AIF I found Shashi's Ax.Net Space blog.

In the article I'm to share he explains, in detail, the following:

  1. Create a transformation library using the Microsoft.Dynamics.IntegrationFramework in a Visual Studio Solution.
  2. Creating classes from XSD, and
  3. Loading the transformation library back into AX 2012.

You can access his article from HERE

Thursday, February 9, 2012

The Future of the Microsoft Dynamics AX Client?

I came across one of Brandon George posts today where he touches a very interesting idea around the future of the Microsoft Dynamics AX client with technologies such Windows 8, XMAL, and HTML 5. 

The post is helpful and it really makes a lot of sense when you start thinking about it. I somehow think that everything is going to end up in the cloud very soon and that "clients" will run based on very simple based systems. Anyway, he will be at convergence talking about this stuff, so let's make sure we follow his tweets at @DynamicsERP

You can access his post HERE

Take care!

Friday, January 27, 2012

Test AIF Service with X++

The following code will allow you to make sure the AIF service is running in our server. In addition, you can use this code to run the AIF service at any moment instead of using a batch process.

static void TEST_AIF(Args _args)
{
    AifGatewayReceiveService agrs = new AifGatewayReceiveService();
    AifInboundProcessingService aip = new AifInboundProcessingService();


    AifGatewaySendService agss = new AifGatewaySendService();
    AifOutboundProcessingService aop = new AifOutboundProcessingService();
    ;


That's all folks!
  }

Tuesday, January 24, 2012

Microsoft Dynamics AX 2012 Services and (Application Integration Framework) AIF architecture



Hi there!

In this post I would like to discuss, in detail, the Application Integration Framework (AIF) and its capability to integrate Microsoft Dynamics AX 2012 with other systems inside and outside an organization.


So what is the AIF and why is important?


The AIF provides capability to integrate Microsoft Dynamics AX 2012 with other systems inside and outside an organization by enabling the exchange of data through XML.


This formatted XML is referred to as a document, and each document contains data and business logic. Documents are based on a document class and defined by using Microsoft Dynamics AX.


Further, AX 2012 ships together with standard document services that support common business processes. As in AX 2009, in AX 2012 we can also customize existing services or create our services.

How documents are exchanged?

The AIF provides an extensible framework for the exchange of XML documents with external systems. The framework supports both synchronous and asynchronous transports.

In synchronous mode, requests are tightly coupled to responses, which means that the submitter of the request must wait for a response from AIF before proceeding.  In this case, AIF does process the request immediately and then sends a response.

In asynchronous mode, however, 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 note that large volumes of messages can be processed more efficiently, and message processing can be controlled by changing various configuration settings. Further, the AIF can be used to send and retrieve data into/from AX.


Inbound / Outbound Exchanges

Inbound exchange, an external system may send a sales order so that the sales order can be saved to the Microsoft Dynamics AX database.
 
Outbound exchange, an external system may 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 – AX sends documents to an external system.
  • Send data in response to requests – 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 AX database. Then AX returns the information to the requesting system.
  • Receive and create data – AX receives documents from another authorized system and creates new records in the Microsoft Dynamics AX database.


AIF Architecture

AX 2012 exposes its functionality through services that are based on Windows Communication Foundation (WCF) and hosted on Application Object Server (AOS).

External applications and client applications on the local area network consume AX services by accessing them directly from AOS. These clients and applications include AX components such as the AX client, Office Add-, and Enterprise Portal.

The following diagram illustrates the services and AIF architecture.







Application Integration Framework Process
  • Internet-based external applications and clients access the AX services through Internet Information Services (IIS).
  • IIS routes the incoming requests for AX services to AOS. All services requests, regardless of their origin, are handled by the WCF runtime that is hosted on AOS.
  • The AIF request pre-processor, if it is configured, can intercept the inbound request messages for custom preprocessing, such as message transforms or value substitutions.
  • The AX service invokes the necessary business logic to process the inbound request message.
  • Similarly, the AIF response post-processor, if it is configured, can intercept the outbound response messages for custom post-processing, such as message transforms or value substitutions.
  • The AIF response post-processor then returns the response to the client.

NOTE:  Microsoft Dynamics AX 2012 no longer includes a BizTalk adapter. For more information about how to use Microsoft BizTalk Server together with Microsoft Dynamics AX 2012, see Exchanging documents between BizTalk Server and AIF.


Services in AX 2012

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 via IIS.
  • Exchanges that are configured to use Web services are processed synchronously and therefore are not queued.
  • 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 Web site that you provide.

NOTE: In general when dealing with the AIF, keep in mind that the AIF user names and passwords are encrypted in the Application.Host configuration file located in C:\Windows\System32\Inetsrv\Config. Therefore, DO NOT copy files from other environments into this location when the AIF and/or Workflow are running in the same machine.


AX 2012 supports the following three kinds of services:
  • Document services are query-based services that can be used to exchange data with external systems by sending and receiving XML documents. These documents represent business entities, such as customers, vendors, or sales orders.
  • Custom services can be used by developers to expose any X++ logic, such as X++ classes and their members, through a service interface.
  • System services are provided by Microsoft Dynamics AX. System services include the Query service, the Metadata service, and the User Session service.
Further, system services are not customizable, and they are not mapped to any query or X++ code. For more information about system services, see AIF System Services.


Integration ports in AX 2012

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 services, and each integration port has a unique Uniform Resource Identifier (URI) that identifies the address of the port.
  • Each integration port also has a direction. An integration port can be either an inbound integration port or an outbound integration port.
  • An inbound integration port is a destination for messages that originate from outside Microsoft Dynamics AX.
  • An outbound integration port is a destination for messages that originate from your Microsoft Dynamics AX system. Inbound integration ports can be one of two types: basic or enhanced. Outbound integration ports are always enhanced ports.

Basic integration ports

Basic integration ports are exposed at a specific Windows Communication Foundation (WCF) endpoint on the Application Object Server (AOS) host. Only a developer can create a new basic integration port.
 


Enhanced integration ports

If 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:
  • A variety of protocols are supported through WCF adapters. These protocols include HTTP, NetTCP, and Message Queuing, which is also known as MSMQ.
  • Enhanced integration ports also support a file system adapter that lets you use file paths as addresses.
  • You can perform pre-processing and post-processing of service requests and service responses.
  • You can create customizations for data contracts by specifying service operations and policies for document data.
  • You can specify advanced security and troubleshooting settings.

Adapters

In AX 2012 services and AIF, integration ports use adapters. These adapters enable AX to communicate by using various transport protocols.

AX 2012 provides the following four adapters that represent predefined bindings:

HTTP adapter – This adapter provides for synchronous message exchanges by using an HTTP or HTTPs transport.

NetTCP adapter – This adapter provides for synchronous exchanges by using WS-* standards support over the Transmission Control Protocol (TCP) transport.

This adapter corresponds to the WCF-NetTcp binding in Windows Communication Foundation (WCF).

MSMQ adapter – This adapter provides support for queuing by using Message Queuing as a transport. Message Queuing is also known as MSMQ.

Message Queuing is a type of asynchronous communication. This adapter corresponds to the WCF-NetMsmq binding in WCF.

File system adapter – This adapter provides support for the asynchronous exchange of documents through file system directories.


Messages and transforms in AIF

In AX 2012 services and AIF, a message corresponds to a Windows Communication Foundation (WCF) message. A message is a self-contained unit of data that can consist of several parts. These parts include a body and headers. When AIF receives and processes an inbound message, it generates an outbound message in response.

Although AIF supports the transfer of data in any arbitrary format, most information exchanges with AIF services use XML documents.

In order to create an XML document that adheres to a standard for a particular exchange of information, AIF requires XML documents to follow an XML style 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.


Schemas

1-Document service schemas: Each document service has a unique schema that describes the fields that can be added, read, updated, and so forth, by using the particular document service.

2-Message schema: Asynchronous exchanges require XML messages to be contained by the AIF message envelope. The namespace for the message schema is:
http://schemas.microsoft.com/dynamics/2011/01/documents/Message

3-Message-set schema: AIF uses the message-set, or batch, schema to contain batched AIF messages in asynchronous exchanges. The namespace for the message-set schema is:

http://schemas.microsoft.com/dynamics/2009/06/documents/Batch

4-Entity key schemas: AIF uses entity key schemas to contain name-value pairs, such as those used to query for a particular item during a read operation or when sending a response to a create operation. The namespaces for entity keys and entity key lists are:

http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKey
http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKeyList

5-Shared types schema: AIF aggregates common property types in the shared-types schema. The namespace for the shared-types schema is:

http://schemas.microsoft.com/dynamics/2008/01/sharedtypes

6-Fault schema: AIF uses the fault schema to contain response messages about error conditions. The namespace for the fault schema is:

http://schemas.microsoft.com/dynamics/2008/01/documents/Fault


Schema locations

You can save XSDs for particular document services, including their imported schemas (such as the shared-types schema) and any port-specific customizations, when you configure data policies for an integration port.

You can retrieve XSDs for common schemas from the following directory where you installed Microsoft Dynamics AX:
Program files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\Application\Share\Include


Processing messages

When you use an enhanced integration port for services and AIF, you can perform custom processing of data, such as XML documents, as each message passes through the integration port. Enhanced integration ports use the following two concepts to process messages during inbound or outbound exchanges:
  • Extensible Stylesheet Language Transformations (XSLT)
  • .NET-based transforms to messages.

In addition, transforms are run for inbound exchanges before they are run for outbound exchanges. Transforms process the whole message. Headers are included in the processing.

NOTE: Transforms apply only to asynchronous exchanges.

.Net-based transforms can convert messages to or from any proprietary format. AX services and AIF can process XML documents only if the documents comply with the service XSD.

If an incoming document is based on XML but uses a different schema, you can use Extensible Stylesheet Language (XSL) to transform the document to the AIF schema.

If an incoming document is not based on XML, such as a comma-delimited file, you can use a .NET Framework assembly to convert the file to the AIF schema.
Pipelines use components to enable the processing of requests for service operations. These components include custom components that are written in X++ code.

For example, if an inbound message contains customer records, your AIF pipeline can contain an XSLT component that updates an element in the XML, based on the value of the customer status element.

Further, your AIF pipeline can contain one or more of any available transformation component. Alternatively, your AIF pipeline can contain no transformation components.

Processing that occurs in pipelines, including XML transformation, applies to both synchronous and asynchronous exchanges.

For inbound exchanges, pipelines are run after transforms. For outbound exchanges, pipelines are run before transforms.

The following diagram shows how data moves through an enhanced inbound integration port.




That's all for now.