Using the optimized interface

To use the optimized interface, you need to create a web reference (legacy endpoint) or a service reference (native endpoint) that connects to the endpoint. The URLs for the legacy and native endpoints have not changed. Only the set of methods provided by each endpoint will have changed.

Hint: The process of creating a new reference will create the new optimized proxy for your application.

Warning: If you are using the native endpoint, be sure that you adjust the settings in the app.config, as described in Application configuration file.

When using the native endpoint, the proxy object created for the optimized interface will have a new name, so you will need to update your code. For the full contract, the proxy object generated by Visual Studio is named DynamicsGPClient. For the optimized interfaces, the main part of the object name is changed to the interface name. For instance, if you were using the ISales interface, the proxy object is named SalesClient.

After you compile your application with the optimized proxy, you should notice two things:

  • The application size should be smaller, because of the reduced number of methods and classes in the proxy code.
  • The application should create a proxy instance more quickly.

When you have thoroughly tested your application with the optimized proxy, switch the endpoints for the Dynamics GP service back to the full contract with static WSDL generation. Be sure that you restart the Microsoft Dynamics GP Service Host so your changes become effective. Then re-test your application to verify that it works properly with the full contract.