Export (0) Print
Expand All

How to: Set Up the app.config File for Mobile Applications

To run a Microsoft Dynamics Mobile application on your mobile device, you must configure the app.config file using one of the following methods.

Connections to the Microsoft Dynamics Mobile - Server Components Web services must be configured to include:

  • Document service for sending documents, such as sales orders or new activities, from the mobile device to Microsoft Dynamics AX or Microsoft Dynamics NAV.

  • Logging service for sending log messages from the mobile device. You will need to provide the URL and path to the service.asmx file.

  • Deployment service for updating the mobile application over the Internet.

For more information, see How to: Install Microsoft Dynamics Mobile - Server Components or Microsoft Dynamics Mobile - Server Components Overview in Microsoft Dynamics Mobile - Server Components Administration online.

Connections to the mobile staging database for replicating data from Microsoft Dynamics AX or Microsoft Dynamics NAV to the mobile device must be configured to include:

  • Mobile staging database Web site.

  • Mobile staging database server (publisher).

For more information, see Configuring the Mobile Staging Database and SQL Server Replication or How to: Install and Configure SQL Server Compact 3.5 Server Tools on the Web Server.

The following procedures describe how to modify the app.config file that is supplied with Mobile Sales, and how to add the proper path in the endpoints for document service, logging service, and deployment service of Microsoft Dynamics Mobile - Server Components.

NoteNote

If you have created your own mobile application using Mobile Device SDK, the app.config file is generated when you build your project in Microsoft Visual Studio 2008.

Open the app.config file

  1. Locate the app.config file.

    The default location is:

    C:\Program Files\Microsoft Dynamics Mobile\Solutions\Microsoft Dynamics Solution\Mobile Sales\Device

    Microsoft Dynamics Solution is the Microsoft Dynamics AX or Microsoft Dynamics NAV version that you are integrating with, for example, Microsoft Dynamics NAV 2009.

  2. To modify the file, open the file with Microsoft Visual Studio or another text editor.

To configure the connections to the Server Components Web services

  1. In the app.config file, locate the <endpoints> element in the configuration of the IEndpointCatalog service.

    <!-- Service for configuring url endpoints. Required by the Request Manager and the Replication Agent -->
    <add type="Microsoft.Dynamics.Mobile.Framework.EndpointCatalog.IEndpointCatalog, Microsoft.Dynamics.Mobile.Framework.EndpointCatalog" factory="Microsoft.Dynamics.Mobile.Framework.Services.Factories.EndpointCatalogFactory, Microsoft.Dynamics.Mobile.Framework.Runtime">
      <configuration xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2008/11/Services/EndpointCatalog/Configuration">
        <!-- This section configures the url endpoints managed by the Endpoint Catalog -->
        <endpoints>
          <!-- The endpoint used for dispatching Request Documents -->
          <add name="MobileDocumentServer" address="https://[Insert URL endpoint]/Document.svc" accountName="default" />
          <!-- The endpoint used for the Logging Service -->
          <add name="MobileLoggingServer" address="https://[Insert URL endpoint]/Logging.svc" accountName="default" />
          <!-- The endpoint accessing used for deployment service -->
          <add name="MobileDeploymentServer" address=" https://[Insert URL endpoint]/Deployment.svc" accountName="default" />        
        </endpoints>
       </configuration>
    </add>
    
  2. For each of the endpoints, replace [Insert URL endpoint] with the correct URL path to the document, logging, and deployment service.

    NoteNote

    To use Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS) you must enable this protocol on the Web site. For more information, see How to: Configure Secure Socket Layer on Web Services.

  3. Save the file.

To configure the connection to the mobile staging database

  1. In the app.config file, to configure the connection to the mobile staging database Web site, locate the <endpoints> element in the configuration of the IEndpointCatalog service.

    <!-- Service for configuring url endpoints. Required by the Request Manager and the Replication Agent -->
    <add type="Microsoft.Dynamics.Mobile.Framework.EndpointCatalog.IEndpointCatalog, Microsoft.Dynamics.Mobile.Framework.EndpointCatalog" factory="Microsoft.Dynamics.Mobile.Framework.Services.Factories.EndpointCatalogFactory, Microsoft.Dynamics.Mobile.Framework.Runtime">
      <configuration xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2008/11/Services/EndpointCatalog/Configuration">
        <endpoints>
    …
          <!-- The endpoint used for SQL Replication -->
          <add name="Replication" address="https://[Insert URL endpoint]/sqlcesa30.dll" accountName="default" />
    …
        </endpoints>
       </configuration>
    </add>
    
  2. Replace [Insert URL endpoint] with the URL of the mobile staging database Web site.

    NoteNote

    To use Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS) you must enable this protocol on the Web site. For more information, How to: Configure Secure Socket Layer on Web Services.

    NoteNote

    To set up the SQL Server Compact 3.5 Edition Server agent of the mobile staging database for the mobile application, in the Replication endpoint, you must enter the URL path to the sqlcesa35.dll file.

  3. To configure the database that publishes data to the mobile device, locate the <subscription> element in the configuration of the IAgentSetCatalog service.

    <add type="Microsoft.Dynamics.Mobile.Framework.Services.IAgentSetCatalog, Microsoft.Dynamics.Mobile.Framework.Runtime" factory="Microsoft.Dynamics.Mobile.Framework.Services.Factories.AgentSetCatalogFactory, Microsoft.Dynamics.Mobile.Framework.Runtime">
      <configuration xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2008/11/Services/AgentSetCatalog/Configuration">
        <!--  This section configures the AgentSets that can be executed by the Synchronization Service. -->
          <agentSets>
            <add name="agentSet 1">
              <agents>
                <add name="Mobile Sales" text="Database" context="Synchronization step;24" optional="true" type="Microsoft.Dynamics.Mobile.Framework.Services.Synchronization.ReplicationAgent, Microsoft.Dynamics.Mobile.Framework.Runtime">
                  <configuration xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2008/11/Agents/Replication/Configuration">
                    …
                    <subscription subscriber="Mobile Sales" publisher="[Insert server with publication here]" publication="pubMobile-Staging" publisherDatabase="Mobile-Staging" database="AppDatabase" systemDatabase="SysDatabase" endpointName="Replication" />
                    …
                  </configuration>
                </add>
    

    The IAgentSetCatalog Service service is used to configure the agents used by the ISynchronizationService Service service.

  4. In the publisher attribute, replace [Insert server with publication here] with the server name of the publisher for synchronizing the application.

  5. Save the file.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft