Showing posts with label BizTalk 2006. Show all posts
Showing posts with label BizTalk 2006. Show all posts

Friday, October 30, 2009

Optional Last field in BizTalk Schema

Hi,

There may be situations where in the last field in your schema may or may not be available. When we generate a schema for this kind some times it will show "Unexpected token found....."

To avoid the same we can try this.

1. Go to your schema
2. Select the last field which may be optional
3. Set min occurs = 0

HTH

Thursday, October 8, 2009

Generate Sequence number using Mapper

To generate a sequence number of a particular record of input shema in result schema we can use either xslt or a functoid in mapper.

This is very simple

1. Drag and Drop Iteration functoid to the mapper.
2. Connect the record header to the functoid as input
3. Connect the result schema sequence number element to the functoid.

That's it

MJ

Monday, July 13, 2009

BizTalk Interview Questions

BizTalk Interview Questions:


1. What is property promotion?
2. What is distinguished Field?
3. What are persistence points?
4. What are the adapters you have worked?
5. What are the challenges you have faced using Soap Adapter?
6. Can you use excel file in File Adapter?
7. Difference between Content Based Routing and Orchestration?
8. What are the communication patterns available in BizTalk?
9. What are the available message types?
10. What is debatching in BizTalk?
11. What is XPath? Benefits?
12. How will you specify delimiters for Flat File?



List of Interview Questions Sites:

http://groups.msn.com/bug-i/biztalkinterviewquestions.msnw

http://www.codeproject.com/useritems/BizTalkInterviewQuestions.asp

http://geekswithblogs.net/sthomas/archive/2005/12/29/64404.aspx

http://biztalkers.blogspot.com/2005/01/biztalk-interview-questions.html

http://www.topxml.com/forum/BizTalk_Interview_Questions/m_3153/tm.htm

http://www.topxml.com/rbnews/BizTalk%20Functoids/re-20587_Biztalk-Server-Interview-Questions.aspx

http://dotnetslackers.com/BizTalk/re-16764_Biztalk_Server_Interview_Questions.aspx

http://biztalkbits.blogspot.com/2005/03/biztalk-2004-interview-questions.html

Distinguished Fields vs Promoted Properties


Distinguished Fields
Promoted Properties
Available within a single
Orchestration instance and
Not available to Receive location/Send
Ports/SendPort Grps
Available for all BTS objects
 
Fields can have any length
 
Fields can have max of 255 chars
Less Performance impact as
nothing is stored in MessageBox
Database.
 
Uses MessageBox Database hence lesser performance
Referred as MessageName.RecordName.ChildRecordName
 
Promoted properties are referred as MessageName(PropertyShemaName.PromotedPropertyName

 

Tips :

We know that promoted properties are available to all BTS Objects. In case we want to restrict some valueable properties being available in HAT and BAM , Go to PropertySchema -> Select the property and Set Sensitive Information = yes  for that particular property.

 

Recoverable Process Interchange

What is Recoverable Interchange?

Take for instance we have multiple messages bundled together and sent as one single unit. Now if one message fails in a bundle of 5 the entire messages will fail. In BTS 2006 we can avoid this using Recoverable Interchange Processing. This is simple but powerful. If one message fails in a bundle of five rest 4 will be delivered in this case. How is that? Kewl isn’t it?

What is Failed Message Routing?

BTS 2006 allows us to subscribe for failed messages which was not available in previous versions


I will use a small example to understand the above concept. Please follow the above steps carefully.

1. Create a Biztalk Project “RecoverAndFailedRouting”
2. Add a schema “OrderEnvelope.xsd”
3. Change the root node “Orders”
4. Add a child record “Order”
5. Add any element to the “Order” Record

Configure the above schema to envelope schema

1. Select the Schema node set Envelope -> Yes
2. Select the root node “Orders” goto -> BodyXpath
3. Select the node which will contain your body schema. In this case it should be “Orders” as it contains the “Order”
4. Save the schema

Create Body Schema

1. Add a new schema “Order.xsd”
2. Change the root node “Order”
3. Add a child element “OrderID”
4. Add a child element “City”
5. Save the Schema

Create a Receive Pipeline

1. Add a new receivepipeline “RecvEnvelope.btp”
2. Add a XmlDissassembler in the disassemble portion of pipeline
3. Set document schema to “Order.xsd”
4. Set the envelope schema to “OrderEnvelope.xsd”
5. Set Validate Document Structure and Recoverable Interchange to true
6. Save all


General


1. Add the .snk file to the project
2. Select solution ->configuration->check deploy
3. Select project->configuratrion->Deployment->Give an application name
4. Deploy the solution

Administration

1. Open the BTS Admin Console
2. Expand the Group and then expand the Application
3. Select the deployed application
4. Create a new receive port a) Pipeline -> RecvEnvelope.btp b) Adapter -> File c) specify File path
5. Create a new send port “SuccessFulMessages” a)Adapter ->File b)Specify Filepath c)Go to Filters -> Add BTS.ReceivePortName = name of the receive port created
6. Create a new send port “FailedMessages” a)Adapter ->File b)Specify Filepath c)Go to Filters -> Add ErrorReport.ErrorType = “FailedMessage” Note : don’t use quotes while filling
7. Start the application


Testing the application
1. Drop the i/p file to receive folder
2. Check all messages
3. if there is an error in any one of the message in the bundle that will be sent to “FailedMessages” folder.

I/p message format : [ All Success ]

<ns0:Orders xmlns:ns0="http://FailRouter.OrderEnvelope">
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_1</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_2</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<Order>OrderID_3</Order>
<City>City_0</City>
</ns0:Order>
</ns0:Orders>


I/p message format : [ Second One Fails ]

<ns0:Orders xmlns:ns0="http://FailRouter.OrderEnvelope">
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_1</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Ordered xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_2</OrderID>
<City>City_0</City>
</ns0:Ordered>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<Order>OrderID_3</Order>
<City>City_0</City>
</ns0:Order>
</ns0:Orders>

Delivery Notification in BizTalk

Answer :

a) Turn the delivery Notification property of Send Port from None to transmitted.
b) Catch the DeliveryNotificationException using xlang and divert it to different folder as required.
Microsoft.XLANGs.BaseTypes.DeliveryFailureException

To achieve this use a scope and set it’s transaction as None. Add an exception handler and catch the above exception.

HTH

Dynamic File Adapter

Answer:

a) Create a send port of type dynamic
b) Before calling the send shape use an expression and enter the following code:
SendPortName(Microsoft .XLANGs.BaseTypes.Address) = “FILE://[Path]/Message.Xml”
Or
SendPortName(Microsoft .XLANGs.BaseTypes.Address) = “FILE://[Path]/” + Message.Destination + “/Message.Xml”

Message.Destination – Promoted Property of incoming message which holds the path

Publishing Orchestration as WebService

1. Create all the Message Schemas
2. Add a request-response port and attach receive to request and send to response part of the port
3. After finishing the orchestration process build and deploy the orchestration to GAC [ Creation of strong name is must ]
4. Open Tools -> Biztalk Web services Publishing Wizard
5. Select Publish Biztalk orchestrations as web services
6. Select the orchestration dll
7. Provide the required target namespace and select project location in the coming wizards and then press create.
8. Go to biztalk explorer, select the orchestration -> Bind the port to webservice port that was created automatically.

Configuring SQLAdapter

The main purpose of using SQL Adapter is to poll the SQLSERVER Database for the required data by executing the query /stored procedure.
We can configure SQL adapter in two ways:1) Receive2) Send
Receive Adapter:
We can use this to extract data from SQL SERVER. This receives data from SQLSERVER. Therefore only select and stored procedure is available.
Restrictions:
1. This adapter can be bound to one-way receive ports2. Supports only select statements3. we cannot return more than one result sets using stored procedures.
Send Adapter:
We can use this adapter to enrich the incoming content by getting the remaining data from SQLSERVER.
We can insert, update and delete data from the tables. We can parameterize and the parameter value dynamically. It can be bound to one-way or two-way solicit response.
General Structure of XSD files:<rootelementname><sync><before><nameoftable fieldname1="’FieldValue1’" fieldname2="’FieldValue2’"></before><after><nameoftable fieldname1="’FieldValue1’" fieldname2="’FieldValue2’"></after></sync></rootelementname>
Insert operations will have only block.Update operations will have both and block.Delete operations will have only block.
How to add the structure and configure SQL Adapter:
Adding:
1. Right click the Biztalk project and select add generated items2. Select add adapter.3. Select the sql adapter4. Click next and set the sqlserver connection string5. Check next and fill up the target namespace and root element name.6. Select between the receive and send adapter of SQL.7. Kindly notice that when you select receive, you will be asked to provide document root element name whereas when you select send, you will be asked to provide request root element name and response element name.
Note: Same name cannot be provided for request and response.
8. Click next and select the type of statement [updategram/storedprocedure].9. If you are selecting stored procedure, select the stored procedure and finish.10. If you are selecting update gram, choose the option between insert/delete/update and finish.
11. Now you can see an orchestration and xsd file.
Configuring:
1. Open the Biztalk Explorer2. Add the receive port and add a receive location3. Select the transport type as SQL4. Select the receive handler and receive pipeline5. You can configure the polling gap by seconds, minutes and hours by selecting polling unit of measure6. You can also specify the polling interval7. Set the connection string8. Enter the document root element name and target namespaceClick on SQL Command ellipse and select the project and schema. You can select only if you have deployed it already.
Tips:
You have forgotten the root element name and namespace. How to retrieve that?Instead of entering the document root element name and target namespace, go and select the project and schema through the SQL Command ellipse.
Sample Stored Procedure creation
CREATE PROCEDURE [SP_GetPODetails] @ID char (1) ASSELECT * FROM Purchase Details where OrderID = @ID for xml auto, xmldataGO
Xml auto:
To provide the result in xml format. This will return table name as the element name and all the columns as its attributes.
<Orders OrderID=”ORD1” Category = “Electronics” /><Orders OrderID=”ORD2” Category = “Hardware” />
Xml auto, elements:
This will provide the result set as a xml with table name as element and columns as child elements
<orders><orderid>ORD1</orderid><category>Electronics</category><orders>
XmlData:
XML DATA is used to generate the information required by SQLADAPTER
Important Note: Once the SQL SCHEMA is generated, remove the xmldata immediately.
Tips:
Are you getting the following error?



The reason is the query you are trying to add in not having XML AUTO

Biztalk Install / Uninstall

To install and Uninstall Biztalk, there is a useful link in microsoft.

http://go.microsoft.com/fwlink/?LinkId=81041

n'joy

How to debug .Net component called within Orchestration

1. Deploy the .Net component in Debug mode

2. Attach BTSNTSvc.exe to the .Net component by selecting Debug Menu - > Processes -> BtsNTSVC.exe.Make sure you are attaching right instance.


That's it and if it's a file drop, drop a file and you will the yellow highlight in the .Net Component

Hope this helps

Could not store transport type data for Primary Transport

Error :
Failed updating binding information. BindingException: Could not store transport type data for Primary Transport of Send Port 'SendPort for success folder' to config store. Primary SSO Server 'BIZTALK' failed. Cannot perform encryption because the secret is not available from the master secret server. See the event log for related errors
try out the below :
1) Go to run -> CMD2) go to <% Installation Drive %>/Program Files/Common Files/Enterprise Single Sign On3) type : ssoconfig -generatesecret d:\ssobkup.bak4)It will ask for password and reminder question
Now you have created the SSO password. You need to restore this password1)ssoconfig -restoresecret d:\ssobkup.bak
That's it.
HTH