Share via


Running the Import GL Transactions sample

To run the application, perform the following steps.

  1. Verify the Dynamics GP service.

    To ensure the Dynamics GP service is installed and ready, enter the service URL into the address bar of the web browser. The default URL for the native endpoint is:

    http://<machine_name>:< port number>/Dynamics/GPService

    Typically, the port number is 48620. If the browser displays a message that states you have created a service, your service is ready to use with the sample application.

  2. Start Visual Studio and open the solution file for the sample application.

    The solution file for this sample is named BatchApplication.sln. The solution file is in the ImportGLTransactions(native) folder inside the Samples folder.

  3. Verify the .NET framework.

    Open the Visual Studio Solution Explorer and right-click the BatchApplication project name. From the menu, click Properties. In the Application tab of the Properties window, verify that the Target Framework shows .NET Framework 3.5 or later.

    If Target Framework shows another .NET framework, use the drop down list to specify .NET Framework 3.5 or later.

  4. Delete the existing service reference.

    In the Solution Explorer, expand the Service References folder. Right-click the DynamicsGPService, and then click Delete. If a message box opens and asks whether to proceed, click OK.

  5. Update the service reference.

    Right-click the Service Reference folder in the Solution Explorer, and click Add Service Reference. In the Add Service Reference window, enter the URL of the native endpoint for the Dynamics GP service in the Address field, and then click Go.

    In the list of Services, click Dynamics GP. Enter DynamicsGPService into the Namespace field and then click OK. The service reference is added to your project.

  6. Generate configuration settings for the native endpoint.

    If you use Visual Studio 2008, you have to generate configuration settings for the application. If you use Visual Studio 2010 or later, you can continue to step 8.

    To generate the configuration settings, you use svcutil.exe. You can run svcutil.exe in a Visual Studio Command Prompt window. To open the window, click the Start menu, find and click Visual Studio, click Visual Studio Tools, right-click Visual Studio Command Prompt, and then click Run as administrator. The Visual Studio Command Prompt window opens.

    To use svcutil.exe, you specify the URL of the native endpoint for the Dynamics GP service and the namespace of the service reference that you created (DynamicsGPService). Enter the following on a single line and then press Enter.

    svcutil.exe http://<machine>:<port>/Dynamics/GPService /n:*,DynamicsGPService

    The svcutil.exe utility creates a file named output.config. Note the location of the output.config file.

  7. Add configuration settings to the app.config file.

    If you use Visual Studio 2008, you have to add the configuration settings to the application configuration file for your project. If you use Visual Studio 2010 or later, you do not need to add the configuration settings and can continue to the next step.

    To add the configuration settings, use the Visual Studio Solution Explorer to find and open the app.config file. For example, double-click app.config under BatchApplication.

    Open the output.config file from the previous step in a text editor. Copy the <system.serviceModel> node from the output.config file and add it to the app.config file.

  8. Update the app.config file.

    To ensure the document sample application works with the messages received from the service, you need to change the default value for attributes of several nodes in the <wsHttpBinding> node of the app.config file. The following XML sample shows how to increase values for the attributes of the <binding> node.

    maxBufferPoolSize="2147483647"
    

maxReceivedMessageSize="2147483647"

The following XML sample increases the value for an attribute in the \<readerQuotas\> node

<pre class="checklistscript" IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml">maxNameTableCharCount="2147483647"
Save the change to the app.config file.
  1. Choose Start Debugging from the Debug menu.

    To build the solution, choose "Start Debugging" in the Debug menu.

  2. Click the Open file button.

    An open file dialog box appears. Navigate to the file named TransactionBatchFile.xml located in the BatchApplication folder found inside the ImportGLTransactions folder.

  3. Select the XML source file.

    Select the TransactionBatchFile.xml file. The textbox on the user interface displays the contents of the XML file.

  4. Click the Begin button.

    This button starts the batch processing of the GL transaction from the XML file.