共用方式為


ObjectProvider configuration files in Connector SDK (4th in the SDK series)

This is the 4th in a 5-part series covering the basics of the SDK for Connector.

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:

Comments

  • Anonymous
    November 16, 2011
    Clear Type Name (ClrTypeName)?!?!?!?!?! msdn.microsoft.com/.../ms229045.aspx

  • Anonymous
    November 27, 2011
    ClrTypeName = Common Language Runtime Type Name This attribute allows Connector to determine the CLR type to be instansiated when syncrozining this record.

  • Anonymous
    December 18, 2011
    So, How can I map UTCDateTime of Dynamics AX to ObjectProvider configuration files? I want to write create or update document(xml) contains like this by Dynamics AX AIF. .... <TestUTC localDateTime="2011-12-21T13:22:00" timezone="GMTPLUS0900SEOUL">2011-12-21T04:22:00Z</TestUTC> .... This this case, I don't know how to write ObjectProvider configuration file(.config).