Friday, 25 March 2011

BizTalk Server Advantages - Why BizTalk Server ?

Some of the Advantages of BizTalk Server are listed below -

1. It is basically an Integration server. It helps in Integrating Enterprise Applications at one common point.

2. Solutions can be developed really fast with BizTalk Server. Effort spent will be less.

3. Updates can be handled in an easy way and maintenance will be easy. BizTalk Server supports Versioning of Artifacts.

4. Negative scenarios can be handled easily with BizTalk Server- eg: If some Service is down, we can set Retry Mechanism,

Alternate Transport Mechanism. It even supports service windows. We can take advantage of enlist and stop features and

prevent losing even a single Message

5. Biztalk is designed to operate in Multi Server Environment. We can run the application on various servers to manage load

and Availability.

6. MessageBox DB designed for optimum performance.

7. Advantage for customers on cost saving in terms of developent time.

8. BizTalk has a number of Tools like BRE, BAM, SSO which be effectively used.

9. It can be used to communicate with wide range of Legacy Applications. There is always a scope to develop custom
Components.

- This is just a very small description of BizTalk Server from a developer point of view. Still BizTalk has a number of
advantages that can be effectively used.

- Shiv

Web Counters


Tuesday, 22 March 2011

BizTalk Server Common Interview Questions

General

1. Explain the Architecture of BizTalk Server.
2. What is a Messaging Agent ?
3. BizTalk Server is Very Costly. Why do you go for it.
4. Advantages of using BizTalk Server.
5. Why BRE ? What are the Advantages over Other Tools as it is very costly for Clients?
6. What is a Host?
7. What is a Host Instance ?
8. How do you run a Host Instance in a different Server ?
9. Difference between Inprocess and Isolated Host ? Why is Isolated Host required ?
10. How do you set the Host as Send/Receive Handlers ?

Schemas & Maps

1. What are the different Types of Schemas ?
2. What is an Envelope Schema ?
3. What is a property schema ?
4. How property Schema differs from Others ?
5. How do you validate the incoming message against a particular Schemas ?
6. What are the ways to reuse Schemas ?
7. What is the difference between Importing and Including a Schema ?
8. What is a Canonical Schema ?
9. What is a Context Property ?
10. Are all Context Properties promoted ?
11. What happens if promoted property is not filled ? Will an exception be thrown.
12. What is the difference between Message Context Property Base and Message Data Property Base in Property Schema ?
13. How can you deploy 2 schemas side by side ?
14. Difference between Value Mapping and Value Mapping Flattening Functiods.
15. What is Auto Mapping Feature ?
16. Database Functoids.
17. Table Looping Functoids.
18. Cross Reference Functoids.
19. Difference between Value and ID Cross Reference Functoids ?

Orchestrations

1. What is an Orchestration ?
2. Read about each and every shape used in Orchestration. Specifically - Parallel, Listen, Compensate
3. Transactions in Orchestration.
4. Difference between Atomic and Long Running Transactions.
5. How to handle Delivery Failures ?
6. How do you ensure FIFO ?
7. Different Orchestration Patterns.
8. What is an Orchestration Instance.
9. How can you build a Singleton Pattern in Orchestration.
10. Convoys.
11. Race Condition and Zombie /Orphaned messages.
12. How can you deploy 2 Orchestration side by side ?
13. How do you update a deployed Orchestration with 0 or Less downtime.
14. How do you debug an Orchestration ?
15. How do you trace the messages processed by an Orchestration ?
16. Difference between call and start Orchestrations
17. Direct Binding ?
18. What are dynamic ports. How will you dynamically set the port.
19. Can we have dynamic send and receive ports ?
20. How do you consume a web/wcf service in an Orchestration ?
21. What are Persistence points ?
22. How do you count the Number of Persistence Points ?
23. What is Correlation ?
24. What are subscriptions ?
25. Which shapes will yield persistence points ?
26. How do you enable FIFO ?
27. What is a Multipart Message ? How do you use that ?
28. What is the use of Compensate shape ?
29. Assume you are using Transactions in your Orchestration. How do you set Timeout incase if you dont receive a response from an external system ?
30. What is XPath ? How can you use that ?
31. Difference between using XPath and using Distinguished fields.

Pipelines

1. Different Stages in Receive and Send Pipelines.
2. How to develop a Custom Pipeline Component ?
3. What are the various interfaces implemented for General, Disassemble/Assemble components ?
4. How do you promote a property in pipelines ?
5. How do you debug a Pipeline ?

Adapters

1. Difference between File and FTP Adapters.
2. Difference between SQL Receive and Send Adapters.
3. What is an updategram ? What is a Before and After Block in Updategram ?
4. How do you consume a WCF Service ?
5. How do you expose your artifacts as a service ?
6. What is the difference between exposing an Orchestration and Schema as a Service ?
7. Consider the Scenario - Everyday, you receive Updates for your BizTalk Hosted Application. You need 30min to perform the Updates. How do you handle this without having any downtime ?
8. What are the different modes of copying in Send File Adapter ?
9. What are the two methods in which File Adapter runs ?
10. What is the Advantage of Using Temporary Location for File Adapters ?

Deployment

1. How do you deploy your application to Test Server ?
2. How do you deploy your application to Production Server ?
3. What are deployment scripts ?
4. What is a Binding File ?

BAM

1. What are activities ?
2. What are Views ?
3. How to capture data for your activities ?
4. What is TPE ?
5. What are the different types of event streams ?
6. What do you enable continuation ?
7. How do you ensure Transactional Integrity with Event Streams ?
8. Difference between Message and Orchestration Event Streams ?
9. What are the different sources of Data (event sources) inside TPE ?
10. How do you set permissions to a view ?

Keep checking this link for more updates regularly. Post a comment if you need help for any Question.

- Shiv

Web Counters


Tuesday, 8 March 2011

Difference between Message Context PropertyBase and Message Data PropertyBase.

This is one of the most commonly asked Question.

Every field in the property schema will be either of Type MessageContextPropertyBase and MessageDataPropertyBase (Default)



You would have already searched about the difference in MSDN which states, MessageDataPropertyBase should be selected, if the property value is filled by the Data within the Message and MessageContextPropertyBase should be selected, if the property is filled with the Data outside the Message.

So, what is the specific advantage of MessageContextPropertyBase?

Simple answer is, it helps us in preserving the Purity of the Message.

For eg: Assume that you process some Order Messages in your Application. During the Processing, you might encounter some error Messages.

Normally, developers add a new Element to the Order Schema and Try to fill that will Error Messages, which will then be used at later part of Orchestration.

But, this is not a good approach. Schema modifications should not be done for this kind of scenarios. Rather, MessageContextPropertyBase can be effectively used to hold the values associated with every message.

In short, MessageContextPropertyBase Element can be used to hold any kind of Metadata associated with the message which can be used to process the Message.

Sample Application: (To show how it can be used)

1. Create a Simple Schema.



2. Add a Property Schema with an Element and Set the Property Schema Base to MessageContextPropertyBase as shown below.



3. Create a Simple Orchestration. Add a Receive Shape to Receive the Message (say Message_1) of Type Schema which you created in Step 1.



4. Create a new Message (say Message_2) of the same Type Schema (created in step 1). Add a Message Assignment Shape. Set the Message Constructed to Message_2. Add the following Code.



Note: Modifying a Context Property is Considered as modifying a message and hence Message Assignment Shape should be used.

Now you created a message with a Custom Context Property. You can now use this message anywhere in the Orchestration as shown below.



This Message_2 can even be passed to any Sub Orchestrations and access the Context Property there.

This way MessageContextPropertyBase helps us in retaining the Purity of Message by keeping all the metadata associated with the message as Context Properties.

Points to Consider about MessageContextPropertyBase:

1. These are written to Message Context. They are not promoted. To promote them, you have to do in a Custom Pipeline or pass the message to a send port that Initializes/Follows Correlation with the Correlation Type Set to this Property.
2. Value can be written to this Property in any Pipeline Component using the Simple Method, InMessage.Context.Promote or InMessage.Context.Write

- Shiv

Web Counters


Wednesday, 2 March 2011

Schema Versioning in BizTalk Server

Imagine, you have a Schema BizTalk Project with a valid Schema and an Orchestration BizTalk Project that is referencing your Schema BizTalk Project.

You deployed you solution and every thing goes fine.

Later you find that some changes are required for your schema to be consumed by a NEW Orchestration and you don’t want to disturb your Original Orchestration which is using your Old Version of the Schema.

How do we resolve this?

2 possible solutions.

1. Why don’t you create a new schema and consume that in your new Orchestration? Very simple right! But what if your manager says, I don’t want a new schema, reuse the same Schema!! See the second option.

2. Use two versions of the schema deploying side by side. How do we do this ?

Using two versions of the same Schema –

1. Create an application with separate project for Orchestration and Schema. Consume the Schema in Orchestration Project. Deploy and Test. Every thing should go fine.

2. Now modify your schema and change its assembly version by going to AssemblyInfo.cs and changing the assembly version.

3. Now deploy the schema project alone. Once this is done, you should be able to see two versions of the same schema in Admin Console.

4. Now its time to retest your First Orchestration which is referencing the Schema of Old Version.

Unexpectedly, you will get the below error.

(Incase if you don’t get this error, it means that you didn’t restart your host instances. Once you restart your host instance you should get this ;) )

This is happening because, BizTalk always tries to use the Latest Version of you schema. But your orchestration is expecting a message of your old Schema Type.

5. To resolve this, open your Receive Location of the Old Orchestation, Expand the XML Receive Pipeline properties and provide the Fully Schema Name ( with Old Version) including the Assembly Name for the DocumentSpecNames Property.

This will inform the Pipeline to use Old Version of the Schema for this Receive Location.

Now you should not get any errors with your Old Orchestration. You can now have another Orchestration that consumes your new version Message.

- Shiv

Note: This kind of scenario is possible only if you have your Orchestration and Schema in a seperate project. What if they are in same project ? You orchestration will even be deployed again along with your schema.

Web Counters

Newly Created Host Instance is not visible in Send / Receive handlers.

Assume that you created a new In-process Host and a Host Instance.

Thought you start the host instance, it will not be immediately visible in Send / Receive Handlers of the Send / Receive Ports.

In order for the Host to be visible inside the Send / Receive Handlers, you have to link the Host with the Adapters.

This is done by Expanding Platform Settings -> Adapters -> Right Clicking any Adapter -> New Send / Receive Handler.


Now, add the Host to the handler.



Now it will be visible in the Send/Receive Handlers.

Hope it helps

- Shiv

Web Counters


How to validate incoming Messages for XML Structure and Data Type using existing XMLReceive Pipeline ?

In every project we develop, we may have to validate input message against schemas for XML Structure and Data Type of XML Elements.

Instead of developing a custom pipeline component for this task, the existing XMLReceive Pipeline can be used.

This can be done in 2 simple steps. This article will explain this validation in full Detail.

Setup the Project:

1. Create a new Project and add a schema with a single Element as shown below. Set the datatype to UnsignedInt.



2. Create a dummy orchestration (not actually required, just for more clarity :)). Receive the message of the above schema type and display its contents into Event Log using an Expression shape.



3. Deploy the application.

Test for the Validation:


Configure the Receive port of the orchestration with a Physical Receive Port.

Ideal XML for the schema deployed should be as follows.

<ns0:Root xmlns:ns0="http://BizTalk_Server_Project1.Schema1">


<MyField>10</MyField>


</ns0:Root>


Test Scenario 1:

Do not set any validation. Use XML Receive Pipeline with default options. Drop the file in the Folder.



Result 1: No Error. Message Contents will be shown in Event Log.



Test Scenario 2:

Modify the structure of the File as below and drop it again.

<ns0:Root xmlns:ns0="http://BizTalk_Server_Project1.Schema1">


<MyField>10</MyField>



<MyField>10</MyField>


</ns0:Root>


Result 2: Still you won’t get any error. Event log will have a normal entry as shown below.


But this should not be ideal. You should be expecting an error which has not happened.

Test Scenario 3:


Set Validate Document in Receive Pipeline to True and drop the file with modified structure again.



Result 3:

An error is thrown saying “Validation can only be performed when document schemas are provided.”



This error is thrown because, for the XML Receive Pipeline, we set the Validate Document to True. But we didn’t provide the name of the schema, against which the XML should be verified. Hence, we see this error.

Test Scenario 4:


Provide the schema name for DocumentSpecNames property of the Receive Pipeline.
It should be given in the following format.

BizTalk_Server_Project1.Schema1, BizTalk Server Project1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b64a0508dbe93103



Now drop the modified file again.

Result 4:


An error will be shown that an extra element is there.



This is it. Now you have set up validation of XML Message using XML Receive Pipeline. The entire validation message should now be displayed.

You can also set up routing of failed message to capture all the messages that failed validation.

- Shiv