The Business Scenario

The Web application we're going to build in this chapter will encapsulate a transaction and submit it to a trading partner who will process the transaction accordingly. Figure 7.1 depicts the type of application that we will build.

Figure 7.1. Application diagram.


As the diagram shows, a process generates a business document as an XML document representing a financial transaction. The purpose of this document is to issue withdrawal notifications to Big Bank Co. For instance, when Jason Jones withdraws $50 from an ATM owned by Sunset Bank, Inc., Sunset Bank needs to notify Big Bank Co. of this transaction (because Mr. Jones is a member of Big Bank Co.). Listing 7.1 is an example of what an XML transaction being sent from Sunset Bank, Inc., might look like.

Listing 7.1. Sample XML Transaction
 <?xml version="1.0" encoding="UTF-8"?>
 <Transactions>
  <Transaction id="ABC-001">
   <Account name="Jason Jones" number="xxx-77-xxx03" />
   <Amount>-51.50</Amount>
   <Type>ATM</Type>
   <Facility>Sunset Bank, Inc.</Facility>
   <Location>
    <Name>Sunset Bank, NW</Name>
   <Address>555 Western Blvd, CA  22222</Address>
  </Location>
 </Transaction>
</Transactions>

The transaction is simple. In the third line of code, the application applies a unique id to the transaction. The fourth line of code represents the account—that is, name and account number; whereas the fifth line tells how much is to be deducted from the account. Notice that an additional $1.50 is added to the initial $50 withdrawal. This represents a transaction fee that Sunset Bank charges for using its ATM. The rest of the document informs Big Bank Co. as to where the transaction was made.

In some cases, there will be a bulk notification to Big Bank Co., with multiple withdrawals (records) per transaction (file). This is okay because we could configure BizTalk to handle each type of transaction.

When the transaction at the member bank is complete, the member bank invokes a procedure to send the processed transaction data to Big Bank Co. When this occurs, the data is transported via HTTPS to an application, such as a SOAP Service, on Big Bank Co.'s servers. Upon receiving the document (a process discussed in more depth later in the chapter), the application forwards the message to BizTalk for processing. Actually, the only processing that likely will occur at this point is a transformation of the data into the necessary output format and some workflow activity. Other than that, BizTalk simply passes the formatted data off to the waiting application for processing. In this case, the application is some kind of financial application that processes ATM transactions for all its customer accounts. To demonstrate a similar scenario, the example code in this chapter is going to simulate the sending and receiving applications using ASP pages. The receiving company Big Bank is simply going to receive the inbound file, transform it into its required XML document format, and then save it to a local file directory.

The first thing we are going to do is imagine ourselves being in Big Bank Co.'s shoes. We have hundreds of business partners who are willing to pass along data to us so that our customers can take advantage of many ATMs across the nation. However, we need to make the integration process inexpensive and easy to accomplish. We are going to do this by allowing all our business partners to send us their data in whatever format they are comfortable with. We, in exchange for getting the data, will take care of the reformatting issues associated with the transaction. For instance, if they want to send us CSV files, that's fine, as long as we know what the format of the CSV files are beforehand. That way, we can set up the necessary map(s), using the BizTalk Mapper, to transform the CSV files into the XML that our application requires. Sunset Bank is going to make the process a little easier on us, however, because it is already sending us XML. The only thing we have to do then is take XML and turn it into an XML document that our application understands.

Note

For more information on XML, see Chapter 2, “XML and Related Technologies.”


Now that we have an idea as to what we are building, let's get started on some coding!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset