Google
 

Wednesday, October 24, 2007

MSMQT

Why isn't MSMQT installed by default?
When the MSMQT service runs it listens on two ports (TCP port 1801 and UDP port 3527). These ports are always open, regardless of whether the application uses MSMQT or not. Having ports open that you do not need poses a security threat, and as a consequence Microsoft decided to not install MSMQT by default.
Secure by Default is one of the foundations of Microsoft's Trustworthy Computing strategy.
How do I uninstall/delete/deactivate MSMQT adapter?
Once installed, you cannot remove the MSMQT adapter!
How can I rename the MSMQT adapter?
The MSMQT adapter cannot be renamed/deleted, it is marked as delete protected.
How can I view messages in MSMQT?
You CAN NOT view messages in MSMQT, because MSMQT has not message store!
MSMQT queues are only logical queues, the physical storage is provided by BizTalk internal queues (stored in SQL Server). As there is no physical representation of the queue, it is NOT possible for a client to query a MSMQT queue.
When a message has been received by MSMQT it is written to the same tables(s) as every other received message, therefore you cannot distinguish MSMQT messages from other messages.
Can I use System.Messaging on the BizTalk machine having MSMQT installed?
Using System.Messaging on the Biztalk machine will not work; this is because System.Messaging needs MSMQ. I.e., you need to install the MSMQ client part to have System.Messaging work.
Which ports are used by MSMQT?
MSMQT only uses TCP 1801 UDP 3527
MSMQ uses all these ports: TCP: 1801 RPC: 135, 2101*, 2103*, 2105* UDP: 3527, 1801
How to write programmatically to MSMQT Queue?
One way to do this is to have MSMQ installed on a remote machine, and then use the MSMQ APIs to send messages to the BizTalk 2004 MSMQT Receive Location Another way can be to create a file receive location that picks up files from some folder and a MSMQT send port which picks up the files from the receive location and sends them to MSMQ.
Can I send a message > 4 MB from MSMQ to MSMQT?
MSMQ by itself does not support large (>4MB) messages. BizTalk 2004 users can use mqrtlarge.dll to send large messages from MSMQ to MSMQT.
Note! This DLL is distributed only with BTS 2004.

Single Sign-On (SSO)

How do I backup the master secret?
As every BizTalk developers see the error in the Event Log saying that you need to backup the master secret, this is a very common question. And the answer is also quite standard...
C:\Program Files\Common Files\Enterprise Single Sign-On\SSOConfig.exe –backupsecret backup_file_name
In a productions server environment the backup file is something that you need to handle with care. You will need it if you have to perform a complete restore of your machine, e.g. due to a hardware failure

Business Rules

How quickly is a new rule published?
The Policy interface allows the user to execute an exact policy version or the latest deployed policy version. The cache gets updated within approximately 60 seconds (polling interval) of the deployment event.
There is no external interface to flush the cache, but if you must then a recycle of the update service will cause the Policy cache to flush itself (again only when it periodically polls the update service for life). The Poling interval is specified in a registry key and defaults to 60 seconds.

Adapters

Using output parameters with SQL Adapter
There is no support for output parameters when using the SQL Adapter.
Accessing remote files with the File Adapter
The File Adapter expects that the remote location has given access rights to the user account running the file receiver/transmitter.
For a receive location, the user account need read and delete access from the receive location, as well as query the contents of the folder.
What permissions do you need to read files using the File Adapter?
You need to have read and delete access on the folder and files, as well as query the contents of the folder.
When write a file using File Adapter, how is it locked?
When the file adapter write a file to disk it places an exclusive lock on the first byte, to prevent two BizTalk systems from trying to write at the same time. However, if you lock a range outside of the first byte, it will succeed.
This means that if another application is reading files in the same folder you need to ensure that the application only read files that it has exclusive access to/lock on.

Orchestration

What is the main difference between Messages and Variables?
This basic answer to this question is quite simple, but it is still a complex issue that took me some time to understand.
· Messages can be sent and received, variables cannot.
· Variables are saved in the orchestration state using .NET serialization. Message parts are serialized into XML and are saved in this form (compressed though) in the message box.
· Message parts are not actually copied when copied/sent/received within BTS, as long as they are not modified. They are passed by DB reference.
· Property/distinguished field can only be applied to messages, and is optimized so that in many cases the data doesn't have to be loaded into memory, or is processed in chunks.
· Message parts are automatically converted between several formats (XmlDocument, .NET object, Stream, XmlReader, etc.)
· Messages are tracked, variables are not.
How to debug an assembly called by Orchestration
When a BizTalk component, pipeline component or orchestration, is deployed it references specific version of each of its dependent assemblies. If the version number does not match exactly the assembly will not be loaded, and if there are multiple versions available only the exact match will be loaded even though there are newer versions available. This is the normal behaviour for .NET!
A common mistake when you try to debug an assembly that is executed by BizTalk is that you debug the wrong version. This may be due to that the version number is changed each time you rebuild your project, this is controlled by the 1.0.* in AssembyInfo.cs. You will avoid problems by hard-coding the version to 1.0.0.
To actually put a break point in your dll - here is what you need to do:
· Build and GAC a debug version of your assembly.
· Restart BizTalk service (BTSNtSvc.exe)
· Attach VS.NET debugger to BTSNtSvc.exe and put a break point in your code.
· Run your orchestration.
How can I be sure that a message has been sent?
If your orchestration needs to know IF the message was successfully delivered you need to set the system context property "AckRequired" on the message before sending it, when the messaging run-time sees this property stamped on the message context it will fire an ACK back to the orchestration once the message is successfully sent.
However, you do not actually explicitly set the AckRequired context property in an orchestration. The orchestration designed has a more convinient way to do this, you simply set the Delivery Notification property on the send port to Transmitted. You will then get an exception if the send operation fails.
Normally when you submit a message to a send port this only means that the message has been sent to the MesasageBox accepted the message and informed the engine that it has ownership of that message, in the case of FILE it means the message has been successfully dropped to disc, nothing more. Similarly, if the transmission fails BizTalk will fire a NACK, you can use try-catch in your schedule to determine the outcome of the transmission. To get this behavior in Orchestration, the port should be marked with Delivery notification required; under the covers the property I mention below will be stamped on the message context.
For the ACK there is nothing to catch, you just won't exit the enclosing scope until the ACK (or NACK) has been received.
How much of C# syntax can you use in an Expression shape?
There are multiple limitations to the syntax in an expression shape. The main reason for this is that the language is NOT C#, but rather XLANG/S. The syntax is identical on supported languge constructs, but the limitations area many. As XLANG/S is so similar to C# in syntax you end up writing C#, just to be reminded of that you cannot use that construct or that keyword.
· Arrays are not supported.
· Indexers or parameterized properties are not supported. The lack of support for indexers are tightly coupled to the lack of support for arrays. This means that you cannot write code like this: res = coll[3];
· You cannot to call-chaining, e.g. xmlDoc.Nodex.Count.ToString() is illegal as you cannot call the ToString method. The worka-round for this scenario is to use System.Convert.ToString(xmlDoc.Nodes.Count).
· No support for using, this means that you need to use the namespace.class syntax all the time.
· foreach, for, do/while, break and continue are not supported.
· Simple types (integer, string, floating point) cannot have the dot operator applied to them. I.e, you cannot write code like this: 6.ToString();
· Comments work fine, but you need at least one statement in the expression box.
· Compound assignment (+=, -=, *=, etc) is not supported.
· Nor is it support to usemore than one assignment operator in a statement.
· Assignment within an “if” or “while” predicate is not supported.
· Increment, decrement are not supported (++, --).
· For message parts, the only member access allowed is on distinguished fields.
· Delegates and events are not supported.
· In construct shapes you cannot do any control flow (if/else or while).

How do you prevent occuring of zombies in a Parallel Convoy?
Refer to the article known as "Convoy Deep Drive" on MSDN

What is the difference between a delay shape vs a listen shape?
A 'Delay' is very much similar to a sleep on the current thread. A 'Listen' shape is used to wait for an incoming resource, with a timeout period.

When you use Call Orchestration shape vs Start Orchestration shape?
A Call Orchestration returns the control back to the caller. A Start Ochestration shape starts the orchestration in a non-deterministic way.

What is the difference between a "Message Assignment" shape and an "Expression" shape?
A "Message Assignment" shape is used to create a new message and assign values to it. A Expression shape is used to assign values to variables and also write 'if' conditions.

Does BizTalk Orchestrations support recursion?
An Orchestration does NOT support recursion.

What is the purpose of the property "Activate" in a Receive shape?
It is used to invoke a new instance of an Orchestration.

Can an orchestration Start without an Activatable receive?
A Nested Orchestration can be started without an Activatable receive

Is it necessary for all .NET components being called from an Orchestration be Serializable?
Yes it is necessary. There are cases where a .NET component need not be Serializable.

When do we need set the property "Synchronized" = true for a scope?
This needs to be set, when a variable is shared across the branches of a parallel shape.

What is the difference between an Exception block and a Compensation block? is it the equivalent of try-catch-finally?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration

Is it possible to have a exception block for an Atomic scope? if not why?
Refer to Parallel Branching and Scoping in BizTalk Orchestrations - Advanced Concepts

How does one enable Correlations in BizTalk?

First create a Correlation type and then create an instance of it.

Is it possible to share variables across two branches in a Parallel shape?
Refer to Parallel Branching and Scoping in BizTalk Orchestrations - Advanced Concepts

Does BizTalk automatically compensate a unsuccessful transaction?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration

What is the main difference between a Long-Running transaction and an Atomic Transaction in BizTalk context?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration

Messaging

How can you programmatic submit messages to BizTalk?
In previous versions of BizTalk you could easily submit messages to BizTalk using the IInterchange.Submit. In BizTalk Server 2004 there is no trivial way to submit messages.
However, you may use the Transport Proxy interfaces to submit messages. There is an SDK sample showing how to programmatically submit documents into the product if you don't want to write a full blown adapter: \Program Files\Microsoft BizTalk Server 2004\SDK\Samples\Adapters\SubmitDirect
Why can I specify multiple maps in a receive port?
To be able to specify multiple maps in a receive port allow you to create a receive port that accept several different types of incoming messages. The advantage with using this approach is that you reduce the number of receive ports that will have to be created and maintained, which reduce administrative effort.
The source schema needs to be different for each map, there will only be one map that matches per message, i.e. one message published regardless of the number of maps configured.
I do not wish to use Orchestrations, only port, schemas and maps. How do I do this?
This is a perfectly valid choice that exclusively uses the part of BizTalk called BizTalk Messaging. I do not think that it is not obvious how you go about implementing such a scenario, so here are some steps that you can follow (the last bullet is the step that is hard to figure out):
· Create your schemas and maps in VS, using a BizTalk Server Project.
· Create a Receive Port using the BizTalk Explorer in VS.
· Apply any maps you wish to perform on inbound documents using the Inbound Maps node in the Receive Port configuration.
· Create a Receive Location that pick up your information.
· Create a Send Port, specifying all necessary information.
· Navigate to Filters & Maps / Filters in the Send Port configuration. Enter the following expression: BTS.ReceivePortName == NameOfYourReceivePort
Does the pipeline executes again when a Send Port retries?
Yes, the pipeline is executed with each retry of a Send Port.
The reason for this is that when a Send Port fails it is the original messages that is put back in the MessageBox. When the retry occur the message is once again sent to the Send Port, which applies maps and executes the pipeline.
What is the difference between distinguished and promoted fields?
There are two different ways in which you can programmatically access an attribute or element in BizTalk, they are called Distinguished Field and Promoted Property. The main differences between them are summarized in the table below.
Promoted properties can do everything and more than distinguished fields, but this doesn't mean that distinguished fields are less useful. Actually you should prefer the use distinguished fields whenever possible:

Distinguished Field
Promoted Property
Syntax
msgOrder.CustomerId
msgOrder(BookShop.CustomerId)
Access method
Using XPath in runtime.
Inserted in message context during pipeline processing.
Can be accesses by
Only in code in orchestrations.
Both in orchestration code and in the messaging configuration (e.g. filters on send ports).
Storage
Only run-time access
A promoted property is stored in the message context.
Constrained by message contents
Yes, only values within the message may be accessed.
No, any type value can be promoted in a pipeline (there is no need for the value to be contained in the message).
Routable
No
Yes, as they are attached to the message context they can be used for routing
Expensive (whatever that means)
No
Yes, even if they are never used they are always read and inserted into the message context. As the message is passed through the MessageBox and Orchestration the context needs to be copied and stored.
Visible in HAT
No
Yes
Size limit
Unlimited
Max 256 characters
XSD type support
More than prom.prop.
Less than dist.fields
Which one of these two ways to access elements/attributes in a message should you choose? The answer will present itself if you answer the following questions:
· Do you need to route on the information in the element/attribute?
· Do you need to track the element/attribute?
· Do you need to use information that can only be dynamically created, i.e., it is not directly accessible in the message.
If the answer to any of these questions is Yes, then you need to use a promoted property. If the answers to all questions are No, then you should use a distinguished field.
Depending on the type of solution you are creating you will find that you use one of these more than the other. Messaging solutions typically use promoted properties to route incoming messages to the correct destination, there is no need to use distinguished fields in messaging solutions as you no way of accessing the value.
If you are building a solution containing orchestrations that model business processes you will probably mainly use distinguished fields. The reason for this is that you will have less need for the routing capabilities of promoted properties, and as it is less expensive from a performance perspective to use distinguished fields you should prefer these. In orchestrations you can use distinguished fields in a number of ways; conditions for looping and decisions shapes, expression shape and message assignment shape.
Basic rule for which to use would be: always use a distinguished field, unless you have to route, track, or correlate on the source content, then use a property (i.e. promoted field).
How do I delete a message in the pipeline?
Say that you want to write a custom pipeline component that writes some data into a database and don't want to include further BizTalk processing. Once the database write is successful you do not need the message anymore. You do not want the engine to write any data into the message box, basically one message gets into the pipe and none goes out.
What you need to do to support this scenario is to return null from the IComponent.Execute, IDisassemblerComponent.GetNext or IAssemblerComponent.Assemble methods
Easy way to get XPath to element
If you need an XPath for a specific element in a document and you're not fluent in XPath (which I'm not) an easy solution can be to open the schema in BizTalk Schema Editor in Visual Studio. When you select a node in the schema you may look in the Instance XPath property (in the Property Window) to find an XPath statement for accessing that element.

Can a flat file message be processing without a pipeline?
A Pipeline's job is to convert any external format into XML, be it a flat file or EDI or anything else.

Can multiple messages be processed or batched without an envelope schema?
It is possible to process multiple messages, without an envelope.

What is property promotion, why is it required?
When a property is Promoted, it is exposed to the orchestration/send port filters etc.

In which scenarios would use a "promoted property" vs "distinguished fields"?
The rule here is, if you dont want the schema element to appear in send port filters/debugging information then make it a distinguished field.

In Biztalk, what does a message type consist of?
A message type consists of the TargetNamespace#RootElement name.

What are un-typed messages, how does one create them?

A message created in BizTalk Orchestration is bound to a schema, this is a typed message. In un-typed messages, the message is bound to System.Xml.XmlDocument instead of a schema.

What is the difference between static, dynamic and direct binding?
Refer to Binding models in BizTalk

How does one enable subscriptions in BizTalk?
A filter on the Send Port is the first step to enable subscriptions in BizTalk.