Export (0) Print
Expand All

CalloutConfigCustomizer Class

CRM 1.2
banner art

Adds callouts to or removes callouts from the callout configuration.

The CalloutConfigCustomizer class exposes the following members.

Constructor Description
CalloutConfigCustomizer Initializes a new instance of the CalloutConfigCustomizer class.

Instance Method Description
AddCallout Adds a pre-callout to the callout configuration document and associates it with an entity.
AddCallout Adds a pre-callout with an OnError action to the callout configuration document and associates it with an entity.
AddCallout Adds a post-callout to the callout configuration document and associates it with an entity.
AddCallout Adds a post-callout with an OnError action to the callout configuration document and associates it with an entity.
AddCallouts Adds a callout to the callout configuration document for each entity in a list of entities.
AddCallouts Adds a callout with an OnError action to the callout configuration document for each entity in a list of entities.
RemoveCallout Removes a pre-callout from the callout configuration document for a given entity.
RemoveCallout Removes a post-callout from the callout configuration document for a given entity.
RemoveCallouts Removes a pre-callout from the callout configuration document for each entity in a list of entities.
RemoveCallouts Removes a post-callout from the callout configuration document for each entity in a list of entities.

Instance Property Description
Xml Gets an XML document that contains the callout configuration.

Remarks

This class enables you to programmatically modify the Microsoft CRM callout configuration file (callout.config.xml). Because the callout configuration file may be "in use" by Internet Information Services (IIS), IIS should be stopped while the configuration file is being edited and restarted after editing is complete.

You should make a backup copy of the callout configuration file prior to modifying it.

Example

The following partial code sample demonstrates how to use the CalloutConfigCustomizer class. The sample code loads a test callout configuration file, adds and removes callouts, and saves the changes to a new callout configuration file.

[C#]

XmlDocument calloutXml = new XmlDocument();

// To keep this readable and easy to edit, preserve whitespace.
calloutXml.PreserveWhitespace = true;

// Load the callout configuration XML file into an XmlDocument object.
calloutXml.Load(@".\IsvReadinessTestFiles\callout.config.xml");

// Add and remove callouts.
CalloutConfigCustomizer calloutEditor = 
   new CalloutConfigCustomizer(calloutXml, "assembly.dll",
   "assemblyClass");
calloutEditor.AddCallouts(new string[] {"account", "contact", "lead",
   "customeraddress", "custom_entity"}, PreCalloutType.PreCreate);
calloutEditor.AddCallouts(new string[] {"account", "customeraddress"}, 
   new OnErrorType[] {OnErrorType.Ignore, OnErrorType.Abort},
   PreCalloutType.PreMerge);
calloutEditor.RemoveCallout("account", PreCalloutType.PreCreate);

calloutEditor.AddCallout("account", OnErrorType.Ignore,
   PostCalloutType.PostCreate, new string[] {"accountid", "name"},
   new string[] {"accountid", "name"});
calloutEditor.AddCallout("opportunity", PostCalloutType.PostUpdate,
   new string[] {"opportunityid", "name"}, null);
calloutEditor.RemoveCallout("account", PostCalloutType.PostCreate);

// Save the XML document to a new file.
calloutXml.Save(@"IsvReadinessTestFiles\new.callout.config.xml");

Requirements

Namespace: Microsoft.Crm.Sdk.IsvReadiness

See Also


© 2007 Microsoft Corporation. All rights reserved.


Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft