Integration Experts – Dipesh Avlani

BizTalk Server, WCF, WF and Cloud computing…

Archive for April, 2011

SFTP adapter available for BizTalk

Posted by DipeshA on April 29, 2011

Hi,

The guys at codeplex have released an excellent addition to the BizTalk adapter family for interaction with SFTP servers. While BizTalk 2010 comes with an FTPS adapter, there is no SFTP adapter available out of the box. I have used this for my latest project and its pretty easy to configure.

You can find it here.

Some differences between SFTP and FTPS…

FTPS and SFTP use different protocols to provide their security layer. FTPS uses SSL or Secure Socket Layer over port 21. The “S” in SFTP does not stand for SSL. It stands for SSH or secure shell, which runs over port 22. It uses less server resources, does not require an FTP server to be running and is a much better security option.

FTPS
Pros:

• Widely known and used
• Provides services for server-to-server file transfer
• SSL/TLS has good authentication mechanisms (X.509 certificate features)
• FTP and SSL/TLS support is built into many internet communication frameworks.

Cons:

• Doesn’t have a uniform directory listing format
• Requires a secondary DATA channel, which makes it hard to use behind the firewalls
• Doesn’t define a standard for file name character sets (encodings)
• Doesn’t have a standard way to get and change file and directory attributes
• Not all FTP servers support SSL/TLS

SFTP

Pros:

• Has good standards background which strictly defines most (if not all) aspects of operations
• Has only one connection (no need for DATA connection)
• The connection is always secured
• The directory listing is uniform and machine-readable
• The protocol includes operations for permission and attribute manipulation, file locking and more functionality

Cons:

• The communication is binary and can’t be logged “as is” for human reading
• SSH keys are harder to manage and validate
• No server-to-server copy and recursive directory removal operations
• No built-in SSH/SFTP support in VCL and .NET frameworks

Posted in BizTalk 2006/2009, BizTalk 2010 | 1 Comment »

Scaling out BizTalk Server

Posted by DipeshA on April 29, 2011

Here is a good article by msdn on how to scale out BizTalk server using different topologies. Click here to read all about it.

Posted in BizTalk 2006/2009, BizTalk 2010 | Leave a Comment »

The message agent failed to register orchestration…

Posted by DipeshA on April 18, 2011

If you see this error while trying to deploy a BizTalk project, it is likely to be due to one of the following reasons:

1) The application does not exist in the BT admin console.
2) You are not using VS in admin mode while trying to deploy the assembly.
3) The application is not fully stopped in the BT admin console at the time of deployment.
4) You have not deployed the dependencies while in VS admin mode.

To get rid of this error, you need to check all of the above and ensure that these conditions are met. Once these conditions are met, this error should go away and your assembly should deploy fine.

Posted in BizTalk 2006/2009, BizTalk 2010 | Leave a Comment »

Modifying xml document in a custom pipeline component

Posted by DipeshA on April 15, 2011

I once came across a situation where I needed to check for empty fields and replace the empty values with a non-empty value to help in promotion of the those properties. Apparently empty fields with closing tags are not promoted by the XML disassembler (see this link). As a result, if you had an orchestration in which the messages were filtered based on certain promoted properties which turned out to be empty, the message would get suspended due to the xml disassembler not promoting these properties.

The solution to this was simple – to create a pipeline component which would replace empty fields with non-empty values.

Create a custom pipeline component which has the execute method implemented as per below and drop this component in the decode stage of your receive pipeline.

 public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg) { 
if (pInMsg == null || pInMsg.BodyPart == null || pInMsg.BodyPart.Data == null)
{
throw new ArgumentNullException("pInMsg");
}
var xmlDoc = new XmlDocument();
pInMsg.BodyPart.GetOriginalDataStream().Seek(0, SeekOrigin.Begin);
xmlDoc.Load(pInMsg.BodyPart.GetOriginalDataStream());
try
{
XmlNode statusNode = xmlDoc.SelectSingleNode("/*[local-name()='Applications' and
namespace-uri()='http://Company.Project.BT.Schemas.SchemaName_v1_0']/*[local-name()='Application'
and namespace-uri()='']/*[local-name()='StageFlag' and namespace-uri()='']");
if (statusNode != null)
{
Trace.WriteLine("Checking if StageFlag node is empty...");
if (string.IsNullOrEmpty(statusNode.InnerText))
{
statusNode.InnerText = "new value";
var ms = new MemoryStream();
xmlDoc.Save(ms);
ms.Seek(0, SeekOrigin.Begin);
pInMsg.BodyPart.Data = ms;
}
}
//this is required or else the next component will fail.
pInMsg.BodyPart.GetOriginalDataStream().Seek(0, SeekOrigin.Begin);
}
catch (Exception ex) { throw; }
return pInMsg;
}

Receive Pipeline

Posted in BizTalk 2006/2009, BizTalk 2010 | Leave a Comment »

No parameterless constructor defined for this object

Posted by DipeshA on April 15, 2011

If you are seeing this exception when testing your custom pipeline components, it is likely due to the fact that your class is marked as partial when using a resource file. Ensure your class is not marked as partial.

[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]

[Guid("dd0af82f-08dc-4aa1-9g0f-f613ab323c69")]

[ComponentCategory(CategoryTypes.CATID_Any)]

public class MyComponent: IComponent, IBaseComponent, IComponentUI

{

private readonly ResourceManager _resourceManager =

new ResourceManager("Company.Project.BT.PipelineComponents.MyComponent",

Assembly.GetExecutingAssembly());

Posted in BizTalk 2006/2009, BizTalk 2010 | Leave a Comment »

TS: BizTalk Server 2010 certification is here!

Posted by DipeshA on April 11, 2011

The BizTalk team has finally come out with a BT 2010 exam after a long interval.
Its here.

Good luck to all of you who are planning to do this exam. I am going to be sitting this exam anytime now.

Snippet:
“Candidates should have a solid understanding of fundamental BizTalk concepts around the core messaging engine and building business processes using orchestrations. Candidates will have some exposure to larger-scale multi-server solutions and deployment/management familiarity. This core knowledge is required for BizTalk 2006 R2, 2009, and 2010. In addition, core knowledge of Windows Communication Foundation (WCF) and Electronic Data Interchange (EDI) is also required….”

Posted in BizTalk 2010 | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.