- IBM WebSphere DataPower SOA Appliances Part I: Overview and Getting Started Juan R. Rodriguez Somesh Adiraju Joel Gauci Markus Grohmann Davin Holmes Tamika Moody. This information contains examples of data and reports used in daily business operations. To illustrate them.
- DataPower Handbook 2nd Edition Volume III. This is Volume III of the long-awaited second edition of the 'bible' and expert guide to deploying, using, and managing IBM DataPower Gateway Appliances. It is updated through firmware version 7.2 and focuses on DataPower development. IBM WebSphere DataPower SOA Appliance Handbooks: 2nd Edition.
The Information as a Service pattern
Data Power Technology
SOA is deployed to repurpose assets in order to expose their data or application logic for reuse throughout the enterprise via a protocol-agnostic exchange of data. One of the most valuable and pervasive pieces of an enterprise architecture is a relational database. The IBM® WebSphere® DataPower® XI50 Integration Appliance, with its hardened security, XML DoS protection, and near-wire speed performance, is able to serve as a viable broker for enterprise data stored in relational databases within an SOA. The DataPower Appliance enables the database to be viewed as a service endpoint accessible via HTTP protocols like SOAP and REST and even non-Web protocols like MQ and JMS. This SOA-driven pattern is referred to as Information as a Service (IaaS).
Download ibm-datapower-handbook or read ibm-datapower-handbook online books in PDF, EPUB and Mobi Format. Click Download or Read Online button to get ibm-datapower-handbook book now. This site is like a library, Use search box in the widget to get ebook that you want.
Beginning in the 3.7.1 firmware release, DataPower database support is much more sophisticated. Capabilities such as parameter markers and full support for stored procedure invocations enable greater use of native database technologies. Other enhancements enable direct interaction with DB2® pureXML, enabling XML to become the lingua franca and making the database a more integral participant in an ever-growing SOA. Figure 1 illustrates the flow of network traffic through the DataPower Appliance collaborating with a back-end database:
Figure 1. DataPower harnessing native database XML support
DataPower database support
Storage and retrieval of enterprise data can be handled on a DataPower Appliance during request, response, and error rule processing. DataPower has several ways to interact with configured SQL data sources. One popular method is the SQL Action that is triggered during rule processing. Another is direct support for executing statements within XSL transformations through the
dp:sql-execute()
extension function and <dp:sql-execute>
extension element. While both methods support executing SQL and XQuery statements, their design and functionality make them different tools that provide flexibility when implementing an IaaS pattern.To permit interaction with a database, the DataPower administrator must first define an SQL data source object within the appliance. A data source is a collection of information required to connect to a database instance, such as connection pooling properties, and the database host, server port, and authentication credentials. Configuration can be performed from a number of management interfaces where the administrator is able to selectively add, delete, edit, enable, and disable data sources. Datasource configurations, such as the one in Figure 2, are specified within a domain so that all service objects and stylesheets within the domain can use a defined data source:
Figure 2. DataPower datasource configuration
Basics of database interaction in DataPower
The two most common methods to send data to and receive data from a database using a DataPower appliance are the SQL Action and XSL extensions.
The SQL Action
The SQL Action is added to a processing rule in the same way all other actions are specified:
Figure 3. SQL Action within a processing rule
The SQL Action is found under the Advanced Action menu and is highlighted in the processing rule in Figure 3 above. This action offers three ways to specify a query. The first is a static string directly defining the SQL or XQuery statement. Second is a query string held in a DataPower variable, likely created in preceding processing. The third is a query generated as the text output of a XSL transformation. Figure 4 shows the configuration of a SQL Action defined with a static SQL statement:
Figure 4. SQL Action configuration
XSLT support
The ability to execute SQL queries in XSL stylesheets is available in the XI50 appliance through the
dp:sql-execute()
extension function. The 3.7.1 firmware release introduced the <dp:sql-execute>
extension element, which extends the database-related capability of the appliance.Enabling an IaaS pattern from within a XSLT stylesheet
The
dp:sql-execute()
function was the first enabler allowing SQL statements to be used directly within XSL transformations on a DataPower appliance. Listing 1 shows the use of the dp:sql-execute()
function handling a typical database query that retrieves information about orders whose totals exceed a minimum cost from the ORDERS
table:Listing 1. Basic use of dp:sql-execute()
This syntax mandates the entire statement (SQL and values) be serialized into a single string before invoking the
dp:sql-execute()
function. The serialization necessitates the use of the inline <value-of>
element to retrieve the values that comprise the query. Performing an INSERT
requires that XML be similarly serialized with the dp:serialize
element. Consider the following input XML document and XSL stylesheet that inserts the data into the database:Listing 2. Sample input XML
Listing 3. Using dp:sql-execute() for data insertion
The
dp:sql-execute()
function is a valuable tool for simple queries that are largely static, but statement serialization makes the function difficult to use when queries grow complex or large. The size of queries are also limited, which means static statements can only contain a small amount of data. Literal statements are also unable to take advantage of certain database performance optimizations. Additionally, the dp:sql-execute()
function lacks support for parameter marking and stored procedures with output parameters. The <dp:sql-execute>
extension element helps ameliorate these deficiencies of the dp:sql-execute()
function.The extension element fills out the functional capabilities of DataPower as a database client, thus augmenting its ability to enable an IaaS architecture. This extension element adds the following features not available with the dp:sql-execute()
function or SQL Action:- Parameter marker support (e.g.
'SELECT * FROM ORDERS WHERE CUSTOMER_ID = ?'
) - Support for stored procedures with
INPUT
,INPUT_OUTPUT
andOUTPUT
parameters
The
<dp:sql-execute>
element adds efficiency and maintainability to the SQL and XQuery statements that can be constructed within XSL stylesheets.Parameter marker support with the <dp:sql-execute> element
Parameter marking makes dynamic SQL statements highly maintainable. Parameter markers separate the static and dynamic content that eventually combine to form a complete SQL statement. They serve as place-holders for values surrounded by the static pieces of an SQL statement. The values of the markers are set programmatically in
dp:sql-execute
elements during processing according to their definition in child <argument>
nodes. When using the dp:sql-execute()
function, an entire SQL statement needs to be serialized to a single string. The <dp:sql-execute>
extension element and parameter markers enable SQL statements to be built logically. Listing 4 below shows how to use parameter markers to perform the same SELECT
query shown above in Listing 1.Listing 4. Using <dp:sql-execute> to SELECT data
The
<dp:sql-execute>
element makes handling XML input easier, too. The stylesheet excerpt in Listing 6 below demonstrates a slightly more complex INSERT
than that of Listing 3 ABOVE. This node iterates through the XML node <orders>
from the input XML document in Listing 5 and inserts each order found into the ORDERS
table. It demonstrates a number of important features, such as the use of the <xsl:copy-of>
element for implicit XML serialization:Listing 5. Input XML with multiple values
The following stylesheet uses the
<dp:sql-execute>
extension element to insert the data from Listing 5 into the database:IDM is not allowed to download or run in Firewall settings. Many FireWalls check the size of application executable file that try to access the Internet. Predator virtual cnc zip password unlocker.
Listing 6. Using <dp:sql-execute> to for data insertion
While both of these examples could have been performed with the
dp:sql-execute()
extension function, their readability and maintainability withinthe stylesheet would be more difficult. Parameter marking helps you specify clean and efficient SQL statements, as well as enabling you to insert larger data sets.Invoking Stored Procedures
Stored procedures are a mainstay in databases due to the procedural roots of enterprise architectures. Their importance has been recognized and incorporated into the
<dp:sql-execute>
element. Stored procedures enable the reuse of SQL statements. They can increase performance for queries that are run multiple times by enabling the database to avoid statement preparation with each query and instead cache any query optimization routines.The usage pattern of stored procedures within DataPower is similar to the examples in Listing 4 and Listing 6, and is demonstrated once again with parameter markers in Listing 7 below. Notice that stored procedures called from the <dp:sql-execute>
extension element can specify the direction of a parameter via the mode
attribute for arguments:Listing 7. Parameter marking with Stored Procedures
Ibm Websphere Certification
Stored procedures with multiple result sets
Stored procedures can return multiple result sets as a result of execution; all SQL methods in the 3.7.1 firmware support this ability. There is no difference when calling astored procedure that returns one result set when compared to a one that returns multiple result sets. However, additional metadata is returned with the result setsreturned from invoking stored procedures, as compared to the results returned from standard SQL/XQuery statements. The additional metadata includes:
- All
INPUT_OUTPUT
orOUTPUT
parameters. <resultSet>
nodes that encapsulate discrete result sets<metadata>
nodes within<resultSet>
nodes to describe the structure of the result set
For example, a stored procedure could return the following XML:
Listing 8. XML with multiple result sets
Differentiating NULL values from zero-length strings
In the result set displayed in Listing 8 above, notice the
isNull
attribute in one of the value nodes. This attributedifferentiates between a value that is explicitlyNULL
from a non-NULL value that is a zero-length string.These metrics are regularly updated to reflect usage leading up to the last few days. The Altmetric Attention Score is a quantitative measure of the attention that a research article has received online. Learn more about these metrics Article Views are the COUNTER-compliant sum of full text article downloads since November 2008 (both PDF and HTML) across all institutions and individuals. Download chemoffice. This manuscript catalogs the chemical shifts for nearly 60 gases and organic compounds which are commonly used as reagents or internal standards or are found as products in organometallic reactions. Tables of 1H and 13C NMR resonances for common organic contaminants are reported in 12 different deuterated organic solvents frequently used to study organometallic systems.
Putting everything we've learned into a final example
Assume that the following data about a company's DataPower Appliances is in the
ASSETS
table:Table 1. ASSET table in a database
MODEL | LOCATION | SERIAL |
---|---|---|
XA35 | B502 | 4777-8643 |
XS40 | B502 | 5908-1324 |
XS40 | B500 | 5823-0923 |
XI50 | B500 | 6021-3452 |
XI50 | B503 | 6341-2934 |
A stored procedure in the database adds assets and returns the new total number of assets of the same model that are owned by the company. The stored procedure is created with the following SQL:
Listing 9. Stored procedure
A stylesheet invokes this procedure through the
<dp:sql-execute>
element to add a XI50 asset. The machine was just procured and has notbeen installed in a location yet, so the value of the location column is temporarily set to null
:Listing 10. XSL stylesheet
This call returns the following XML for post-processing in the result variable. Listing 11 shows the resulting XML with the updated count of XI50 assets returned in the
OUTPUT
parameter:Listing 11. Results
The table now contains the new asset:
Table 2. Updated ASSET table
MODEL | LOCATION | SERIAL |
---|---|---|
XA35 | B502 | 4777-8643 |
XS40 | B502 | 5908-1324 |
XS40 | B500 | 5823-0923 |
XI50 | B500 | 6021-3452 |
XI50 | B503 | 6341-2934 |
XI50 | NULL | 6987-2541 |
Ibm Websphere Data Power Service Gateway Xg45
Conclusion
The DataPower Appliance offers great flexibility to an SOA, as its unique position in the network enables it to efficiently handle the requests, processing, security, and validation of enterprise data. The enhancement of database functionality in the DataPower XI50, such as the
<dp:sql-execute>
extension element, enables the X150 to further streamline the flow of data to and from a database.This overview may get you excited for the possibilities of using DataPower to fulfill Web service requests and maintenance of enterprise data. The IBM Data Studio team has realized the power of this scenario and developed Data Web Services as a feature of IBM Data Studio Developer. This tool helps you quickly expose SQL statements as Web services, and generates artifacts that you can deploy on a DataPower appliance, thus enabling the IaaS pattern. The developerWorks article What’s new in IBM Data Studio Developer V1.2 can help you understand just how easy it can be to use IBM Data Studio and DataPower together.
Downloadable resources
Related topics
Comments
Sign in or register to add and subscribe to comments.