Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2006 : Custom Components (part 2) - Key BizTalk API Objects

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
8/3/2014 9:28:42 PM

Key BizTalk API Objects

All pipeline components, regardless of what they do, will use the interfaces described in thefollowing subsections. Likewise, most of the pipeline component interfaces defined previously accept these interfaces as arguments. That being said, it is important to understand these interfaces first before proceeding. The following is based on material from the BizTalk Server documentation on MSDN.

IPipelineContext

IPipelineContext is the main interface that defines the operations and properties for thepipeline instance. The MSDN documentation from Microsoft provides good examples for how these interfaces are to be used. Tables 1 and 2 show the interface's public properties and methods. The key method here is the GetMessageFactory method. This method will return a message factory for the pipeline that can be used to create new messages using the CreateMessage method.

The GetMessageFactory method is the main way to create new messages from withina pipeline component. Also note that you will need to call IPipelineContext. GetMessageFactory.CreateMessagePart to create the message part for the message. A message is simply a construct that contains zero to many message parts. Once you create the message part, you can assign it to the IBaseMessage object through the AddPart method.

Table 1. PipelineContext Public Properties
PropertyDescription 
ComponentIndexGets the index of the current component in the stage.
PipelineIDGets the ID of the pipeline with which this pipeline context associates.
PipelineNameGets the name of the pipeline.
ResourceTrackerGets the IResourceTracker object associated with the pipeline context. This object can be used to track and dispose non-CLR resources.
StageIDGets the ID of the current stage in the pipeline.
StagendexGets the index of the pipeline stage where the current component is located.

Table 2 . PipelineContext Public Methods
MethodDescription
GetDocumentSpecByNameGets an IDocumentSpec object for the specified document name
GetDocumentSpecByTypeGets an IDocumentSpec object for the specified document type
GetGroupSigningCertificateGets the signing certificate for the group
GetMessageFactoryGet access to the helper interface to work with BizTalk Server message objects

IBaseMessage

IBaseMessage is the base interface that defines a BizTalk Server message. Tables 3 and Table 4 show the public properties and methods. The MSDN documentation from Microsoft provides good examples for how these interfaces are to be used. Note that messages, created using the IPipelineContext.GetMessageFactory.CreateMessage method, will implement this interface. This will still need an IBaseMessagePart to be assigned through the AddPart method for any data to be included with the message.


Table 3. IBaseMessage Public Properties
PropertyDescription
BodyPartGets the body part, or main part, of the message
BodyPartNameGets the name of the body part, or main part, of the message
ContextGets or sets the message context
IsMutableGets a value indicating whether the message can be changed by components during processing
MessageIDGets the unique message ID for the message
PartCountGets the total number of parts in the message

Table 4. IBaseMessage Public Methods
MethodDescription
AddPartAdds a part to the message.
GetErrorInfoGets the exception that caused the error.
GetPartAccesses the message part. This is indexed by PartName.
GetPartByIndexRetrieves a part and its name by supplying the part index.
GetSizeGets the size of the message.
RemovePartRemoves a part from the message.
SetErrorInfoSets the error information.

IBaseMessagePart

IBaseMessagePart is the interface that defines a BizTalk message part. Table 5 and Table 6 show its public properties and methods. The message part is assigned to an IBaseMessage through the AddPart method. Note the Data property. The MSDN documentation from Microsoft provides good examples for how th. This is the property used to assign a value to the message part. The Data property accepts and returns only streams. This is incredibly useful, as it allows any stream to be assigned to the message part. This includes XMLReader streams, MemoryStreams, and raw BinaryStreams.

Another rarely used item is the PartProperties property. This is essentially a property bag that can be used to store information and metadata about the part. In reality the PartID, Charset, and ContentType are actually contained in the PartProperties IBasePropertyBag object.

Table 5. IBaseMessagePart Public Properties
PropertyDescription
CharsetGets or sets the character set property for the part
ContentTypeGets or sets the content type property for the part
DataGets or sets the part data
PartIDGets the part with a unique ID
PartPropertiesGets or sets one or more properties that describe the part data or contain custom information about the part

Table 6. IBaseMessagePart Public Properties
MethodDescription
GetOriginalDataStreamRetrieves the original uncloned version of the part data stream
GetSizeRetrieves the size of the part

IBaseMessageContext

IBaseMessageContext is the interface used to interact with and manipulate the object context accessible through the IBaseMessage.Context property. Table 7 and Table 8 show the public properties and methods. The MSDN documentation from Microsoft provides good examples for how these interfaces are to be used. The main items of interest here are the Promote, Read, and Write methods. Properties that exist in the context can never have a Null value. A Null value means that the property does not exist. For example:


  • Attempting to set (or promote) a property value to Null deletes the property and returns the COM result S_OK.

  • Attempting to read a nonexistent property returns Null.

Table 7. IBaseMessageContext Public Property
PropertyDescription
CountPropertiesGets the number of properties in the message context

Table 8. IBaseMessageContext Public Methods
MethodDescription
AddPredicateAdds a message predicate to the message
GetPropertyTypeGets the type of the property
IsMutableIndicates whether the message context can be changed by components during processing
IsPromotedEnables the component to determine whether a property has already been promoted in the message context
PromotePromotes a property into the message context
ReadGets a property value from the message context by the name-namespace pair
ReadAtGets a property from the message context by index
WriteWrites a property into the message context

PipelineUtil

PipelineUtil is a helper class that exposes the three methods shown in Table 9. These methods are invaluable when you need to create a new message. The MSDN documentation from Microsoft provides good examples for how these interfaces are to be used.


Table 9. PipelineUtil PublicMethods
MethodDescription
CloneMessageContextCreates a clone of the message context for a given message. This is useful for copying the message context of one message to another.
CopyPropertyBagCreates a clone of the property bag for a given message. This is useful for copying the property bag of one message to another.
ValidatePropertyValueChecks that the object is a valid property value.

This class is unsupported and is part of the BizTalk product infrastructure. If you run into trouble using it, Microsoft Product Support may not support you. However, it is common knowledge that it exists and makes pipeline component development much easier.

Other -----------------
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Enabling Archiving (part 2) - Using Exchange 2010 Discovery, Offline Access
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Enabling Archiving (part 1) - Archive Quotas , Exchange 2010 Discovery Operation Considerations
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Placing a Mailbox on Retention Hold, Litigation or Legal Hold
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Exchange Server 2010 Email Archiving - Policies
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Industry Best Practices
- Microsoft Exchange Server 2010 : Getting Started with Email Archiving - Archiving
- Microsoft Exchange Server 2007 : Implementing Client Access and Hub Transport Servers - Installing the Hub Transport Server
- Microsoft Exchange Server 2007 : Implementing Client Access and Hub Transport Servers - Transport Pipeline
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 4) - Message Classification , Rights Management and the Hub Transport Server
- Microsoft Exchange Server 2007 : Hub Transport Server Policy Compliance Features (part 3) - Journaling
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server