Chapter: XML and Web Services : Building XML-Based Applications : Using XML in the .NET Enterprise Servers

BizTalk

Microsoft BizTalk Server 2000 is one of the .NET Enterprise Servers that makes Business-to-Business (B2B) communication happen. Many times, a single company can no longer provide everything to its customers.

BizTalk

 

Microsoft BizTalk Server 2000 is one of the .NET Enterprise Servers that makes Business-to-Business (B2B) communication happen. Many times, a single company can no longer provide everything to its customers. For instance, a bookstore may need to rely on a shipping partner to ship a book that a customer orders. In the past, these sorts of sit-uations have been handled either by hand or by very complex automation routines that would provide this information to the partner in a “nightly dump” or similar manner. With the growing sophistication of today’s applications, we need the ability to send these notifications in a more timely manner. This is what’s known as business-to-business com-munication; it’s the idea that one business relies on an outside partner to accomplish cer-tain tasks and notifications of what’s expected to be sent to the partner company. BizTalk Server is, in essence, a routing service that receives and routes B2B messages in a very efficient and flexible way. BizTalk Server 2000 allows you to set up business relation-ships with a large number of partnering organizations (which may all be using different

 

standards), define the standards used by your business partners, and the map between the various standards with which you deal.

 

The BizTalk Management Desk can be considered the “BizTalk control center.” This is where a typical BizTalk user would go to set up organizations, agreements, document formats, mapping and routing information, and so on. However, before we can discuss some of the more advanced management capabilities with BizTalk Server 2000, we first need to explore the basic items that make BizTalk Server 2000 tick.

 

Organizations

 

Organizations are the cornerstones of all BizTalk scenarios. Organizations simply are business partners. There’s always a “home” organization (that’s you) and at least one other organization with which the home organization does business.

 

Setting up organizations is easy. You can create a new organization through the File, New menu. An organization typically has little more than a name that identifies it. However, you can specify as many additional identifiers as you want. You can choose between standard identifiers, such as Dun & Bradstreet (DUNS) numbers, or you can set up custom identifiers.

 

Ports

 

A port can be considered the routing destination of a message, which can be an organiza-tion, as mentioned earlier, or an application, as you’ll learn later in this chapter. Ports

 

do not necessarily reference business partners, because there can be ports for routing messages or documents internally or for routing messages to the home organization. For instance, imagine a scenario in which Company B places an order with Company A (the home organization). That order is received and then routed to the home organiza-tion for processing.

 

You can create a new port from the File menu by choosing File, New, Port. When you’re defining a port, one of the first settings that needs to be specified is the application name and the primary transport mechanism. The transport address specifies the mechanism and the destination to be used for the document. Here are the available mechanisms:

 

   HTTP and HTTPS

 

   SMTP

 

   File

 

   Message Queues

 

   Application Integrator Components

 

   Loopback

 

By specifying HTTP and HTTPS as the routing mechanism, you indicate that BizTalk needs to route the document to a Web server. A value of SMTP tells BizTalk to route the document as an e-mail, whereas a value of File signals to the BizTalk Server to route the document to a local file. Identifying a routing mechanism of Message Queues tells the BizTalk Server to invoke Microsoft Message Queuing Services when routing a docu-ment. The value Application Integrator Components lets you route documents to custom destinations, and the value Loopback let’s you route the document/message back into the BizTalk Routing Services.

 

Frequently, you will encounter a scenario in which you must route a document or mes-sage to another organization. In this case, you’ll need to specify the destination organiza-tion and the transport mechanism to use to route the document or message. Additionally, you can also set up security and encryption information as well as some other advanced settings. Okay, so now you know how to route a document once it’s in the BizTalk sys-tem. However, you do not know how to get a document from an external source into the system in the first place. This is done through channels. Every port needs to have at least one channel in order to be useful. When you’re creating a new port, BizTalk automati-cally asks you to create a new channel for the port (unless you deselect that option in the last step of the wizard) .

 

Channels

 

Channels route a message from an organization or application to the assigned port. During this process, the document may actually be converted or mapped from one stan-dard into another standard. When setting up a port, you are automatically asked by the wizard to create a channel. Alternatively, you can right-click a port in the Management Desk and select New Channel, From an Organization, which also launches the Channel Properties Wizard.

 

To create a new channel, you’ll need to specify a source organization, the type of “inbound” document to route, and the type of “outbound” document to create. This allows you to say, in essence, that you expect to receive a certain type of document and you need to route this document to a certain port in a particular format. If the inbound and outbound documents are different, the incoming document needs to be converted, or mapped. (We will discuss document maps later in this chapter.)

 

Document types have to be defined in BizTalk using schemas, which allows you to accept a business partner’s document format as long as it is well defined and valid. However, just because you can accommodate a business partner’s document format doesn’t mean you have to use that format internally. In fact, you may have your own standard for the same document type.

Applications

 

In BizTalk, applications are not necessarily programs or components. They are simply sets of logically connected transactions. Applications are defined in the home organiza-tion’s Organization definition. To create a new application, simply click the New button in the Applications page or the Organization Properties dialog box, specify a name, and you’re finished.

 

Document Definitions

 

Document definitions comprise another important building block for BizTalk systems. All messages that are routed through BizTalk have to be defined, which is done using XML schemas. Document definitions can be very simple, specifying only a couple of fields in a document, or they can be very complex, defining field types and lengths and even BizTalk routing information.

 

Microsoft BizTalk Server 2000 provides a tool to create document definitions called the Document Editor. The BizTalk Document Editor is basically a schema editor with some special features for BizTalk. When you create a new document, the Document Editor allows you to base the new document on a template or to start with a blank document. You can then proceed to add new records and fields. By default, records are the equiva-lent of tags, and fields equate to attributes. However, you can change that and actually turn a field into a tag by changing the Type setting in the Declaration page. The major difference between records and fields is that records can have subrecords and fields as child items, whereas fields cannot. The editor basically gives you all the freedom XML schemas provide. You can set the data type, valid values, minimum and maximum con-tent length, default values, whether a field or record is optional or required, the number of times a tag can occur, and much more.

 

In addition, the Document Editor can handle BizTalk-specific settings, such as routing information. BizTalk-specific information is specified in the Dictionary page. All this information is handled under the BizTalk namespace. You can add your own namespaces to provide information specific to your document format. Simply click the Namespace page to do so.

 

BizTalk document definitions can be stored as regular files on your hard drive or in a WebDAV repository.

 

Document Maps

 

Document maps define how one document type is to be converted into another and are created using the BizTalk Mapper. To create a new map, select File, New from the menu bar and then select the source document definition and the destination document defini-tion. This opens both document formats and displays them in the BizTalk Mapper. You can now start mapping documents, field by field, using simple drag-and-drop operations. The map is complete once all the fields in the destination receive a value from the source. This information is stored in a WebDAV repository or the local hard drive, where it can be referenced from BizTalk Server.

Also, not all the fields are necessarily straight maps. Some of them may need to use “functoids.” These are the little boxes you see in the center of a map. The number of available functoids is large and ranges from simple string manipulation and mathemati-cal functions to scientific calculations and even scripts.

 

WebDAV

 

Web-based Distributed Authoring and Versioning (WebDAV) is an extension to the HTTP protocol that allows users to collaboratively edit and manage files on remote Web servers and provides standard ways to handle issues such as locking and access control.

 

WebDAV is an open standard that is used by many companies, including Netscape, Novell, Xerox, Microsoft, and others. Microsoft Office 2000 represents one of the most popular implementations of the WebDAV standard for office collaboration.

 

Microsoft BizTalk Server 2000 uses WebDAV for authoring document definitions and maps (although you can also save these documents on your hard drive without using WebDAV).

For more information on WebDAV, refer back to Chapter 13, “XML and Content Management,” or visit www.webdav.org.

 

Distribution Lists

 

Distribution lists allow you to route messages to several organizations at once, which is useful for distributing information such as price lists and catalogs. Regular ports always map to one and only one organization. A distribution list, though, is linked to an infinite number of ports that will receive the routed message. All these ports need to have a spec-ified destination.

A distribution list is linked to a channel, just like ports are usually linked to channels, only this time, the distribution list spreads the information to a number of ports.

 

Submitting Documents

 

Now that you have a basic understanding of BizTalk Server and its most important com-ponents, features, and tools, it’s time to submit your first document. To start, we’ll do so using Visual Basic code.

 

Communication with BizTalk is handled through a COM-based interface, thus making document submission a simple process. Let’s assume we want to route an XML docu-ment containing an order into BizTalk so we can process the order. We would take the XML document we wish to submit to BizTalk and, within a method in a Visual Basic object, write something like the following:

 

DIM  loBT  AS  Object

 

DIM  lvResult  AS  String

 

SET loBT = CREATEOBJECT(“BizTalk.Interchange”) lvResult = loBT.Submit 1,SourceDocument, DocumentType,

 

”Organization Name”, NameOfSourceOrganization, ”Organization Name”,”Home Organization”

As you can see, the code is rather simple and straightforward. We create an instance of the BizTalk.Interchange object and call the Submit() method, passing in the content of the source document (our XML document containing our orders). In this example, we are manually routing the document, which means we pass information about the docu-ment format as well as the source and destination organizations. Parameter 3 specifies the document type that has to be set up in the BizTalk Management Desk. Parameters 4 and 5 specify the source organization identifier and the actual name or the source organi-zation. Parameters 6 and 7 do the same for the destination organization.

 

Assuming the XML document is valid according to the schema we set up, BizTalk Server will find a channel/port pair that matches the document type as well as the defined organizations.

 

In addition to explicitly specifying the source and destination organizations in the Submit method, the XML document itself can contain routing information. Such documents are known as self-routing documents. Self-routing documents contain information about the source organization, destination organization, document type, and organization identi-fiers. Basically, self-routing documents enable you to call the Submit() method and pass only the first two parameters. All this information has to be identified in the document definition to indicate to BizTalk Server where that information can be found. This is done using the Dictionary tab in the Document Editor.

 

Depending on the submitted message, the routing information can be contained in the actual message (this is typically the case in BizTalk Framework–compliant messages) or in an envelope.

 

When you’re submitting a self-routing document, the basic steps are the same as with manually routed documents (discussed earlier), with the difference being that only the first two parameters are passed to the Submit() method.


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
XML and Web Services : Building XML-Based Applications : Using XML in the .NET Enterprise Servers : BizTalk |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.