Enterprise Solutions

Dynamics GP Web Services

Dynamics GP Web Service

The Web Services for Microsoft Dynamics GP provide an ideal way for external applications to integrate with the data contained in the Microsoft Dynamics GP accounting system. The web service for Microsoft Dynamics GP provides access to the primary documents in the accounting system. Some of the document types include:

  • Customers
  • Vendors
  • Sales documents
  • Purchase documents
  • Receivables transactions
  • Payables transactions
  • General ledger transactions
  • Accounts

Through the web service, integrating applications can retrieve documents, create new documents, update existing documents, and delete or void documents.

The web service for Microsoft Dynamics GP is fully integrated with the Dynamics Security Service. The administrator of the web service can configure security so only specified users are allowed to perform actions like creating or updating sales documents.

Getting started with web services

To start developing an application that accesses the Dynamics GP service involves the following

  • Endpoints
  • Connecting to the Legacy Endpoint
  • Connecting to the Native Endpoint
  • Dynamics GP Service Object Model
  • Methods
  • Data types
  • Context

Endpoints

Two endpoints are available to use with the Dynamics GP service. To use the service, you must first create a connection to one of those endpoints.

Legacy endpoint

The legacy endpoint uses the BasicHttpBinding. Consider using the legacy endpoint in the following situations:

You are upgrading an application that had integrated with the Dynamics GP web service from an earlier release of Microsoft Dynamics GP.

You are using a development tool that supports only standard ASMX-based web services (such as those created with ASP.NET). For example, applications created with Visual Studio 2005 can connect only to ASMX-based web services, so they must use the legacy endpoint.

By default, the URL for the legacy endpoint is:

http://machine_name: port/DynamicsGPWebServices

The port value is typically 48620. You can find the full URL of the legacy endpoint, including the port number, in the DynamicsGPLegacy.config file on the server that is running web services. This file is typically found in this location:

C:\Program Files\Microsoft Dynamics\GPWebServices\ServiceConfigs\

When you view this URL in a web browser, you will see some basic examples of code that connects to the service.This is shown in the following illustration.

 

Native endpoint

The native endpoint uses the WSHttpBinding. Consider using the native endpoint in the following situations:

You are creating a new application that will integrate with the Dynamics GP web service, and your development tool supports the WSHttpBinding used for the native endpoint.

You need the improved performance or features of the native endpoint. The development tool you use must support the WSHttpBinding. Visual Studio 2008 and later support connections to the native endpoint.

You need the improved security provided by the native endpoint. By default, the data exchanged with the native endpoint is encrypted.

By default, the URL for the native endpoint is:

http://machine_name: port/Dynamics/GPService

The port value is typically 48620. You can find the full URL of the native endpoint, including the port number, in the DynamicsGP.config file on the server that is running web services. This file is typically found in this location:

C:\Program Files\Microsoft Dynamics\GPWebServices\ServiceConfigs\

When you view this URL in a web browser, you will see some basic examples of code that connects to the service.This is shown in the following illustration.

Connecting to the Legacy Endpoint

The legacy endpoint has the behavior of a standard ASMX-based web service. To connect to it, you will add a web reference for your project. After the development tool has been given the URL of the legacy endpoint, it will retrieve the WSDL file that describes the service. It will use this information to build the proxy classes for the service.

Connecting to the Native Endpoint

The native endpoint uses the wsHttpBinding. To connect to it, you will add a service reference for your project. After the development tool has been given the URL of the native endpoint, it will retrieve the WSDL file that describes the service. It will use this information to build the proxy classes for the service. To connect to the native endpoint, you must be using a development tool that allows connections to services that use the wsHttpBinding. Visual Studio 2008 and later can create references that connect to the native endpoint.

Dynamics GP Service Object Model

The Dynamics GP service contains numerous objects that you can work with through the service. To effectively use the service, it’s helpful to understand how these objects work together to represent data in the system. Information about the object model is divided into the following sections:

  • Object categories
  • Inheritance
  • Learning the object model
  • Endpoint differences
  • Dynamics GP Web Service Reference
Methods

To perform tasks with the Dynamics GP service, you must call the methods provided. The following sections introduce the methods available in the service:

Method categories

The methods for the Dynamics GP service can be divided into the following categories: Get, GetList, Create, Update, and Delete or Void.

Framework methods

The Dynamics GP service also provides several methods that help you work with it

Data types

Several types of data are represented in the properties defined in the objects for the Dynamics GP service. This portion of the documentation provides details you will need to know as you work with these different data types in your own applications

  • Standard data types
  • Enumerations
  • Account numbers
  • Choice types
Context

The Context object is used for every method in the Dynamics GP service. It provides important details that specify how the method call should be performed. Information about the Context object is divided into the following sections:

  • Organization key
  • Culture
  • Currency
  • Role key
  • Tenant name
  • WorkOnBehalfOf

Using the Web Service

The following actions can be performed using the web service

Creating Objects

The Dynamics GP service allows new objects to be created in Dynamics GP. Information about creating objects is divided into the following sections:

  • Create methods
  • Create policy

 

 Retrieving Objects

An individual object or list of objects can be retrieved through the Dynamics GP service. The objects returned by the service will be populated with data from Microsoft Dynamics GP. Information about retrieving objects is divided into the following sections:

  • Retrieve methods
  • Individual objects
  • Lists of objects
  • Restriction reference
Updating Objects

The Dynamics GP service can be used to change the values of individual properties for existing objects in Dynamics GP. Information about updating objects is divided into the following sections:

  • Update methods
  • Update policy
  • Concurrency
Deleting or Voiding Objects

An individual object can be deleted or voided through the Dynamics GP service. Deleted objects will be removed from the database. Voided object will remain in the database, but be in the voided state. Information about deleting or voiding objects is divided into the following sections

  • Delete or void methods
  • Delete or void policy
Exceptions

The Dynamics GP service returns errors as SOAP exceptions. The SOAP exceptions are classified as either system exceptions or validation exceptions. System exceptions are events that prevent normal completion of Dynamics GP service methods. Validation exceptions occur when data passed into a method violates the data validation rules for an object.

The Dynamics GP service maintains an exception log that contains detailed information for each exception that occurs. You can view the exception log entries to help you troubleshoot problems encountered by the Dynamics GP service methods. Methods in the Dynamics GP service also provide access to validation exception log entries so they can be handled or displayed by the application calling the service. Information about exceptions is divided into the following sections:

  • Exceptions console
  • System exceptions
  • Validation exceptions
  • Handling exceptions in code
Policy

Policy is a security-related feature for the Dynamics GP service. The policy system allows the Dynamics GP service administrator and the application using the Dynamics GP service to control how business objects are created, updated, or deleted. Information about policy is divided into the following sections:

  • Policy overview
  • Configuring from the Dynamics Security Console
  • Configuring from code
  • Using policy in a web service application
Other Programming Techniques
  • Calling methods asynchronously
  • Working on behalf of another user
  • Tenant-aware applications
Entity ID Filtering

Several objects in Dynamics GP have identity information associated with them. Examples include the Customer ID for customer objects, or the Salesperson ID for sales document objects. The Dynamics GP service can use entity ID filtering to restrict access to these objects, based on the Windows User ID of the person accessing the web service. Information about entity ID filtering is divided into the following sections:

  • Setting up entity ID filtering
  • Security for entity ID filtering
  • Implementing entity ID filtering
  • Filtering limitations
Entity Action Tracking

The Dynamics GP service can be configured to track the actions performed on several of the core business objects. This is useful when you want to keep data in Microsoft Dynamics GP synchronized with an external system

Optimized Proxy

The Dynamics GP service contains over 350 web methods. When you create a web reference or service reference for the Dynamics GP Service, the proxy generated contains code to access all of these methods. In many cases, your web service application will use just a small subset of the available methods. To optimize the proxy, you want to access a smaller set of methods. The following sections describe how to do this:

  • Using a predefined optimized interface
  • Available interfaces
  • Configuring the endpoint
  • Using the optimized interface

About The Author

One comment

  1. November 21, 2017 at 9:52 am

    Performed it for awhile, the sport is alright.

Leave a Reply

*