Visual Studio 2008 and later
To connect to the native endpoint of the Dynamics GP service with Visual Studio 2008 and later, you need to add a service reference to your project. The following procedure explains how to do this for a C# project.
Choose to add a service reference.
In the Project menu, choose Add Service Reference. The Add Service Reference window will be displayed.
Supply the URL for the native endpoint.
Refer to Endpoint URLs to determine the URL to use. After the URL has been entered, click Go to search for the native endpoint. When the service is found, its information will be displayed.
Supply the namespace.
The items in the service proxy will be added to a namespace. The Namespace control provides a place to enter the namespace you want to use.
Hint: Throughout this documentation, the proxy for the native endpoint is added to the namespace "DynamicsGPService".
Specify the advanced options for the service reference (optional).
Click Advanced to display the advanced options for the service reference. In most cases, you won't need to change any of these settings.
One advanced setting you may need to change is the Generate asynchronous operations option. If you will be making asynchronous calls to the service, you must mark this option so that the proper asynchronous methods are added to the proxy. Refer to Calling methods asynchronously for details about making asynchronous calls.
Hint: The proxy generated for the web service reference to the legacy endpoint always contains the asynchronous operations.
Click OK to save the advance settings.
Create the service reference.
Click OK to create the proxy for the service reference.
Hint: The Dynamcis GP service is very large. Creating the service reference in Visual Studio can take a few minutes. During that time, Visual Studio will not be responsive.
The following illustration shows the service reference in a Visual C# project that connects to the native endpoint of the Dynamics GP service.
Adjust the buffer sizes for the service reference.
Due to the large document sizes and the quantity of data that can be sent to and retrieved from the Dynamics GP service, some of the default buffer size values must be adjusted. Refer to Application configuration file for details about the app.config file and the buffer values that need to be adjusted.
Warning: Due to the large size of the Dynamics GP service, the connection settings for the app.config are not always generated when a service reference is added to the project. If this situation occurs, you will need to manually add entries to the app.config file. A sample app.config file can be found later in Application configuration file. You can also generate the configuration settings using the svcutil.exe, which is described in Using SvcUtil.exe.