24 March, 2010

Biztalk Promoted Properties

Another lovely issue that had me scratching my head: in a schema in Biztalk, I believe that elements that are defined as type "xs:string" have essentially an unlimited length, or at least "unlimited" for any typical purpose that I would come across.

HOWEVER, if that element is specified as a promoted property, then it becomes limited to 256 characters. See "Limitations for Promoting Properties" here.

Sigh.

23 March, 2010

Re: BizTalk Config Settings

Try creating a helper class that reads the settings from your config file. You should be able to call that from within a message assignment shape in a construct block with no problems.

Ross' Inaugural Post: Biztalk Config Settings

Note to Selves: evidently code that retrieves settings from the Biztalk config file (BTSNTSvc.exe.config) such as:

ConfigSettings = (System.Collections.Specialized.NameValueCollection) System.Configuration.ConfigurationSettings.GetConfig("MySchedule");
My_Dynamic_SP(Microsoft.XLANGs.BaseTypes.Address)= "mailto:" + ConfigSettings.Get("ValidationErrorsEmailTo");

... cannot be used in a Construct Message shape because the NameValueCollection is somehow retrieved as a ReadOnlyNameValueCollection, and that class is not serializable, and that is unacceptable (the transaction type of everything is set to 'None'). Nor, does it seem, can it be done in an Expression shape in a Decision tree for (most likely) the same reason.

I put it in an Expression shape near the beginning of the orchestration, saved the value to a variable, i.e.:

errorEmailTo = ConfigSettings.Get("ValidationErrorsEmailTo");

... and used the variable later on in the Decision tree, and everything works. For now.