Introduction

This sample demonstrates how to develop a mobile connector for Microsoft Dynamics AX 2012 that communicates with mobile client.   

See related code sample Developing Secure Mobile Apps for Dynamics AX 2012.

The sample app enables an employee to submit expense reports from a mobile device while traveling.

The code provided in this sample supports the walkthroughs in Developing
Secure Mobile Apps for Dynamics AX 2012
white paper.  Refer to the white paper for a detailed
description of the solution architecture and implementation.

A mobile app for Dynamics AX 2012 enables users to send transactions to Dynamics AX 2012 even if they are not in the same domain or network as the on-premises instance of AX. For example, the solution lets clients access an AX service that may be running behind a firewall. The solution involves the following components:

The following diagram illustrates how different components interact to enable the mobile app to communicate with Microsoft Dynamics AX.



 

The following walkthroughs in Developing Secure Mobile Apps for Dynamics AX 2012, which correspond to the source
code files in this sample, demonstrate the steps for creating a mobile client app:

  1. Design and create the AIF service in Microsoft Dynamics AX 2012
  2. Create the middle-tier WCF service
  3. Develop the client to communicate data to the middle-tier WCF service
  4. Implement active federation and claims-based authorization for the mobile client
  5. Authenticate the user and send the data to the service

Source Code Files

The development environment and pre-requisites,  can be found in the walkthroughs for each of
these components.

  1. ExpenseConnectorService:
    This folder contains a Visual Studio 2010 project that implements the Middle-Tier WCF service. This code corresponds to the ‘Create the Middle-Tier WCF Service’ walkthrough in Developing
    Secure Mobile Apps for Dynamics AX 2012
    .  This also contains the windows installer project to install the service, which is ‘SampleConnectorWindowsService’.  This folder also contains Sample_Expense_Mobile_Capture.xpo:  Which contains X++ code for the AIF service described in the walkthrough and needs to be imported into Dynamics AX from the Development environment. This code corresponds to the ‘Design and create the AIF service in Microsoft Dynamics AX 2012’ walk through in Developing
    Secure Mobile Apps for Dynamics AX 2012
    .

See the related code samples at Developing Secure Mobile Apps for Dynamics AX 2012.

 

  1. ContosoMobileWindowsPhone:
    This folder contains the Windows Phone implementation of the mobile client. The client communicates to the WCF service and implements authentication to ADFS.  This is a Visual Studio project which needs the Windows Phone SDK installed as a prerequisite for Windows Phone 8 or 7.1. This corresponds with the walkthroughs entitled ‘Develop the client to communicate data to the middle-tier WCF service’, ‘Implement active federation and claims-based authorization for the mobile client’,  and ‘Authenticate the user and send the data to the
    service’ in Developing Secure Mobile Apps for Dynamics AX 2012.
  2. ContosoMobileJSClient:  This folder contains the JavaScript
    implementation for the mobile client. This corresponds to the ‘Developing RESTful JavaScript Mobile Apps for Dynamics AX 2012’ section in Developing Secure Mobile Apps for Dynamics AX 2012. The code demonstrates communication with the WCF service as well as authentication to ADFS.

 

 

Building the Sample

Prerequisites

Building the projects

More Information