Tuesday, May 13, 2008

Orchestration


This is a sample of BizTalk Orchestration which receives a request from a receive port on a receive location, constructs it and passes it on to the send port for sending it to a web service. This web service is exposed from a remote application and we are making its use in our application.

Once the request is sent to the webservice with the message from the send port, web service replies with a response which we again capture at a receive port in the orchestration, and then we can handle it the way we want.

Thursday, April 24, 2008

XML in Stored Procedures

In the last post we discussed a case study which stated that in BizTalk XML is the communication language.

Here I would like to add, how to use XML in the Stored Procedures? With the intruduction of SQL Server 2005, Microsotf added support for XML. Now an XML document can be passed in the stored procedure and then we can do extract the data from the XML document after getting its Handle. In the same manner Stored Procedures can now return XML.

When we wanted the order generated to be passed to the orchestration in BizTalk, we wanted that to be in XML format, and to get that in the XML format we have to write the stored procedure in such a manner that it would return XML document to us.

FOR XML Clause:
Now, when you write a 'Select' statement in a stored procedure you can use 'FOR XML' clause to generate the XML of the recordset returned from the select query.
e.g.
SELECT fieldname1, fieldname2 FROM tablename FOR XML AUTO

The XML returned from the stored procedure can now be recieved at a recieve location where the SQL Adapter is configured in the BizTalk Orchestration. Once the receive location gets the XML document it is passed to the Receive PORT.

For further information on SQL usage in Stored Procedures, please visit the links available.

In the next post I would post a image of an Orchestration created for a real word application and would describe every component of it.

Tuesday, April 15, 2008

Case Study Contd...

Use of Biztalk in the Central Order Generation System:
In the central order generation system, the order gets generated and must be served to the subscribing systems. These subscribing systems could be of any platform with any ERP, e.g. SAP, etc. There has to be a platform independent way to transfer the messages to the systems and receive acknowledgement as well. Here comes the role of BizTalk.

In our case we have out the entire order generation logic in the stored procedure which create an order from the database and return the Order in a well formed XML format. Many people still wonder why XML?, the answer to it is that XML is the only data type rather format which has been supported by almost every system/platform existing today. Once we get an XML Order we need to expose a web service which could when called could serve this order to the subscribing system.

Think of the days when were doing this coding our way through, how much do we think we would have spent on creating an application which would take the order from the SQL Stored Procedure, apply some business logic in it, get the transactions going, create some statistical report based on it and eventually exposing it as a web service. BizTalk makes this just a game of configuring various components provided in it.

Create an Orchestration with a SQL Adapter configured to receive data from the SQL Stored Procedure, use some transformation shapes to transform the message, use pipelines and maps to decide the flow, and in the end create a SOAP adapter for receiving the request and serving the Order. BizTalk has inbuilt support for transaction which could be long running and atomic and several other features.

Management can use BAM provided by Biztalk and see the orders moving through the system. Developers have got the BizTalk Administration console to configure Orchestrations and ports and location to receive. BizTalk reduces the development time considerably and lets the solution developers focus on "What to do?" rather than thinking "How to do?".


In the next post we would discuss about Use of XML in Stored Procedures and consuming the result of stored procedures in BizTalk Orchestration and eventually exposing that as a web service.