This is the 2nd in a 5-part series covering the basics of the SDK for Connector.
We’ll start with “A” for Adapter. The Adapter is a critical piece of Connector for Microsoft Dynamics. Without it, you can’t interface with another system. This post explains some of the highlights of the Adapter template and sample code including settings, the use of IDisposable, and the necessary “using” statements for an Adapter.
The Adapter has a number of settings inherited from the base Adapter class in the AAL DLL. These include
In the InitializeSettings() method, there is also some settings including username, password, company, and webServiceUrl. They are pretty straightforward and do not need to be hard-coded as the client application will request this information when you first install the files in the Adapters folder.
Generally, when dealing with web services it is advisable to properly implement and utilize IDisposable to release resources that are being used by the Adapter. The SampleAdapter has IDisposable implemented and provides an example of how to implement IDisposable when using Web Services.
The templates include a couple simple “using” statements that include the base namespaces for the templates. However, in the SampleAdapter, there are more namespaces used. For most Adapter that you write, you’ll probably need to add a least a couple of these namespaces:
Other namespaces may need to be used depending upon your specific implementation and needs.