Friday, October 15, 2010

Which is the Send Handler (Host) that my Dynamic Send Ports use?

When we define a Static Send Port, we can set the Send Handler that this Send Port will use:


But when we define a Dynamic Send Port, we haven't this possibility:


Then, which is the Send Handler for this Send Port? After debugging some pipeline components, I found that the process that I have to attach is the default Send Handler for the protocol that the Dynamic Send Port uses:


This is a problem when we have two Dynamic Send Ports, that have to execute under different host instance processes, under the same protocol.

Static SMTP Port With Dynamic Behaviour

According to the Microsoft definition about configuring a SMTP port (http://msdn.microsoft.com/en-us/library/aa578155(BTS.20).aspx):
If the property is set in an orchestration or in a custom pipeline component in a receive pipeline, then:
  • If the message is sent to a static send port, the property value will be overwritten with the value configured for that send port.
  • If the message is sent to a dynamic send port, the property value will not be overwritten.
If the property is set in a custom pipeline component in a send pipeline, then:

  • The value will not be overwritten regardless of whether the message is sent to a static or dynamic send port.
And we want to give a dynamic behaviour inside our orchestration to our static SMTP send port, we need to implement three items: a pipeline component, a send pipeline and a property schema. We need also, set the properties inside the orchestration that uses the static SMTP port.

1. The Property Schema

We have to define a property schema, with the properties we want to give a dynamic behaviour in the static SMTP port, for example:


2. The Pipeline Component (SMTPPropertiesComponent)

We implement a pipeline component to map the value (in the message's context) of the properties of our property schema, to the properties of SMTP schema. In the IComponent's Execute method we do this mapping:

object oEmailText = pInMsg.Context.Read(EMAIL_TEXT_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oAttachmentName = pInMsg.Context.Read(ATTACHMENT_NAME_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oRemainingParts = pInMsg.Context.Read(REMAINING_PARTS_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oFrom = pInMsg.Context.Read (CUSTOM_FROM_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oTo = pInMsg.Context.Read (CUSTOM_TO_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oSubject = pInMsg.Context.Read (CUSTOM_SUBJECT_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
object oCC = pInMsg.Context.Read (CUSTOM_CC_PROPERTY, CUSTOM_PROPERTY_SCHEMA_NAMESPACE);
        
if (oEmailText != null)
   pInMsg.Context.Write(EMAIL_BODY_TEXT_PROPERTY, SMTP_PROPERTY_SCHEMA_NAMESPACE, oEmailText);
if (oAttachmentName != null)
   pInMsg.BodyPart.PartProperties.Write(FILE_NAME_PROPERTY, MIME_PROPERTY_SCHEMA_NAMESPACE, oAttachmentName);
if (oFrom != null)
   pInMsg.Context.Write(FROM_PROPERTY, SMTP_PROPERTY_SCHEMA_NAMESPACE, oFrom);
if (oSubject != null)
   pInMsg.Context.Write(SUBJECT_PROPERTY, SMTP_PROPERTY_SCHEMA_NAMESPACE, oSubject);
if (oCC != null)
   pInMsg.Context.Write(CC_PROPERTY, SMTP_PROPERTY_SCHEMA_NAMESPACE, oCC);
if (oTo != null)
   pInMsg.Context.Write(OUTBOUND_TRANSPORT_LOCATION, SMTP_PROPERTY_SCHEMA_NAMESPACE, string.Format("mailto:" + oTo));

if (oRemainingParts != null)
   pInMsg.Context.Write(MESSAGE_PARTS_ATTACHMENTS_PROPERTY, SMTP_PROPERTY_SCHEMA_NAMESPACE, (uint)oRemainingParts);

return pInMsg;
3. The Pipeline

In the send pipeline, we only need to use our pipeline component.

4. The Orchestration

In the orchestration, in the construct shape of the message to send, we set our custom values:

Error upgrading to SWIFT Message Pack 2010 from Message Pack 2009

This days I am working in our SWIFT application update to Message Pack 2010.

When I try to install de Message Pack 2010 in my computer, I received the error "Setup cannot proceed with the upgrade because an error occurred while creating a backup copy of the message folder"


The problem is that my Windows is a spanish XP Windows and don't have the folder c:\Program Files and the Message Pack MSI tries to backup the old 2009 message into c:\Program Files.


The solution is easy, simply create a c:\Program Files directory and you can install without problems.

Wednesday, October 13, 2010

Value does not fall within the expected range

If we have two orchestrations running under different host instances in the same application and we try to start the Application from biztalk admin console or scripts, we can get this error message:

Could not enlist orchestration 'OrchestrationName, OrchestrationName Version=1.0.0.0, Culture=neutral, PublicKeyToken=780b3672abbbdefd'. Could not enlist orchestration 'OrchestrationName, OrchestrationName Version=1.0.0.0, Culture=neutral, PublicKeyToken=780b3672abbbdefd'. Value does not fall within the expected range. (Microsoft.BizTalk.SnapIn.Framework)

Follow this fix to solve the problem:

http://support.microsoft.com/kb/927052/

Failed to connect to the SQL database SSODB

If we are experimenting problems with SSODB in our development environment and we have the following entries at the event viewer:

Could not create SSOSQL. To fix the problem, reinstall SSO or try 'regasm SSOSQL.dll' from a Visual Studio command prompt. Error Code: 0x80131700
OR
The SSO service failed to start. Error Code: 0x80131700

We have to execute the following command:
regasm %Program Files%\Common Files\Enterprise Single Sign-On\SSOSQL.dll

Consuming Asynchronous flows as a Synchronous flow without An Orchestration

This article explains how to build an scenario, when we need to offer to our clients synchronous flow and we consume an asynchronous flow, without orchestration.

This also, we can use to offer an asynchronous interface as a synchronous interface.

http://blogs.msdn.com/b/appfabriccat/archive/2010/06/23/msdn-blogs.aspx

Error: Failed to update binding information

if we import a bindings file and we get the following error

Error: Failed to update binding information
The following items could not be matched up to hosts due to name and/or trust level mismatches:

Item: ‘’ Host: ‘’ Trust Level: ‘’

You must do one of the following:

1) Create hosts with these names and trust levels and try again

2) Re-export the MSI without the binding files and have a post import script apply a suitable binding file


We need to check the Host names in our binding file. The import bindings file process is case sensitive with the Host names.

Microsoft BizTalk Accelerator for SWIFT 3.0 Fixes and SPs

The BizTalk Accelerator for SWIFT 3.0 Service Pack 1 is available
http://support.microsoft.com/kb/946694

FIX: The VEF, GHS, SDG, and MZN currency codes are missing in Microsoft BizTalk Accelerator for SWIFT Message Pack 2008
http://support.microsoft.com/kb/961072/

FIX: A required update is available to enable a feature in BizTalk Accelerator for SWIFT 3.0 that allows for country code validation and currency code validation by referencing the database tables
http://support.microsoft.com/kb/954731/en-us/

ERROR: BRE Deployment Utility not working after installing 2008 Message Packs
http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/d877332a-215e-456d-abb8-d1ec045a3d0c