The ObjectProvider Configuration Files
This post is all about the configuration files that accompany each ObjectProvider file used by Connector. In this post we will look into the configuration files used by the SampleCustomer and SampleUofMSchedule ObjectProviders, and then we’ll look at an attribute of these files that needs to be set to properly deploy the Adapter.
What’s the deal with the ObjectProvider configuration files?
Each ObjectProvider used by your adapter must be accompanied by a configuration file that helps the adapter understand the types contained in the object. For example, a Customer object has an attribute of type Address. The configuration file for each ObjectProvider specifies these types using an XML-style definition set. These configuration files must be named appropriately as well. For example, a SampleUofMScheduleObjectProvider must be named SampleUofMScheduleObjecProvider.config and be placed in the ObjectConfig directory in the same directory as the directory where the ObjectProvider file is located. This will allow the ObjectProvider configuration files to be automatically found and loaded by the Adapter when you initialize the Adapter after dropping the necessary files in the “Adapters” folder.
If you open up either of the ObjectProvider configuration files, you will notice that it is an XML file. The important thing to note is that all TypeName must be defined or their will be error. Also, the TypeName must be spelled exactly as the way they are spelled when defined. Also, the Clear Type Name (ClrTypeName) must be designated using your unique namespace where the reference to the Dynamics GP Web Service exists. Finally, note that you can modify these configuration files to reflect any customizations that have been made to the entities.
Don’t the configuration files need to be copied to the output folders when you build the solution?
Yes, the configuration files need to be copied to the output folder when you build the solution. If these configuration files do not have the “Copy to Output Directory” file attribute set to “Copy Always”, they will not be copied to the output folders at each build. This could lead to outdated configuration files or not configuration files at all in the output folder at build time. Therefore, you must make sure that the attribute is set appropriately on all ObjectProvider configuration files. Below is a screenshot of the attribute and the proper setting: