Tib Amx Service Bus Development Tutorials

24
TIBCO ActiveMatrix ® Service Bus Development Tutorials Software Release 3.1.2 April 2011

Transcript of Tib Amx Service Bus Development Tutorials

Page 1: Tib Amx Service Bus Development Tutorials

TIBCO ActiveMatrix® Service BusDevelopment TutorialsSoftware Release 3.1.2April 2011

Page 2: Tib Amx Service Bus Development Tutorials
Page 3: Tib Amx Service Bus Development Tutorials

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED ORBUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ONFUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOTLICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSEAGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THEREIS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYEDDURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSEFILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSEAGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THISDOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTEACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.

This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No partof this document may be reproduced in any form without the written authorization of TIBCO Software Inc.

TIBCO, The Power of Now, TIBCO ActiveMatrix, and TIBCO Enterprise Message Service are either registered trademarksor trademarks of TIBCO Software Inc. in the United States and/or other countries.

EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems,Inc. in the U.S. and other countries.

All other product and company names and marks mentioned in this document are the property of their respective owners andare mentioned for identification purposes only.

THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATINGSYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THEREADME FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEMPLATFORM.

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR APARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGESARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED INNEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGESIN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY,BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TOANY RELEASE NOTES AND "READ ME" FILES.

Copyright (c) 2005-2011 TIBCO Software Inc. ALL RIGHTS RESERVED.

TIBCO Software Inc. Confidential Information

TIBCO ActiveMatrix Service Bus Development Tutorials

Page 4: Tib Amx Service Bus Development Tutorials
Page 5: Tib Amx Service Bus Development Tutorials

Contents

Preface..................................................................................................7TIBCO Product Documentation................................................................................................8

Other TIBCO Product Documentation......................................................................................9

Third-Party Documentation....................................................................................................10

Typographical Conventions....................................................................................................11

Connecting with TIBCO Resources........................................................................................13

Chapter 1 Basic SOA Design Tutorials...........................................15

Chapter 2 Mediation Tutorials.........................................................17

Chapter 3 Policy Tutorials...............................................................19Configuring the ResourceInstance Attribute in an External Policy.........................................20

Preparing an Application that Injects Resource Instances into Policies.................................21

Glossary..........................................................................................................23

TIBCO ActiveMatrix Service Bus Development Tutorials

TOC | 5

Page 6: Tib Amx Service Bus Development Tutorials

TIBCO ActiveMatrix Service Bus Development Tutorials

6 | TOC

Page 7: Tib Amx Service Bus Development Tutorials

Preface

TIBCO ActiveMatrix® Service Bus is a scalable and extensible platform for developing, deploying, and managingapplications that conform to a service-oriented architecture.

TIBCO ActiveMatrix Service Bus Development Tutorials

Page 8: Tib Amx Service Bus Development Tutorials

TIBCO Product Documentation

The following documents form the TIBCO ActiveMatrix® Service Bus documentation set:

• Concepts: Read this manual before reading any other manual in the documentation set. This manual describesterminology and concepts of the TIBCO ActiveMatrix platform. The other manuals in the documentation set assumeyou are familiar with the information in this manual.

• Development Tutorials: Read this manual for a step-by-step introduction to the process of creating, packaging, andrunning composites in TIBCO Business Studio.

• Composite Development: Read this manual to learn how to develop and package composites.• Mediation Component Development: Read this manual to learn how to configure and implement Mediation

components.• Mediation API Reference: Read this manual to learn how to configure and implement Mediation components.• Administration Tutorials: Read this manual for a step-by-step introduction to the process of creating and starting the

TIBCO ActiveMatrix runtime, starting TIBCO ActiveMatrix servers, and deploying applications to the runtime.• Administration: Read this manual to learn how to manage the runtime and deploy and manage applications.• Installation and Configuration: Read this manual to learn how to install TIBCO ActiveMatrix Service Bus software

and create and upgrade runtime objects.• Release Notes: Read this manual for a list of new and changed features, steps for migrating from a previous release,

and lists of known issues and closed issues for the release.

TIBCO ActiveMatrix Service Bus Development Tutorials

8 | Preface

Page 9: Tib Amx Service Bus Development Tutorials

Other TIBCO Product Documentation

You may find it useful to read the documentation for the following TIBCO products:

• TIBCO Enterprise Message Service™

TIBCO ActiveMatrix Service Bus Development Tutorials

Preface | 9

Page 10: Tib Amx Service Bus Development Tutorials

Third-Party Documentation

• Service Component Architecture

– Service Assembly Model V1.00– Policy Framework V1.00– Transaction Policy V1.00– JMS Binding V1.00

• World Wide Web Consortium Web Services

– WSDL 1.1– SOAP 1.1– Web Services Addressing

• OASIS

– Web Services Reliable Messaging 1.2– UDDI Version 3

• Internet Engineering Task Force

– SMTP RFC 5321– LDAP RFC 4510

• Java Community Process

– JDBC 4.0– JMS 1.1

• Hibernate

TIBCO ActiveMatrix Service Bus Development Tutorials

10 | Preface

Page 11: Tib Amx Service Bus Development Tutorials

Typographical Conventions

Table 1: General Typographical Conventions

UseConvention

TIBCO products are installed into an installation environment. A product installed into an installationenvironment does not access components in other installation environments. Incompatible products

TIBCO_HOME

ENV_NAMEand multiple instances of the same product must be installed into different installation environments.An installation environment consists of the following properties:

• Name Identifies the installation environment. The name is appended to the name of Windowsservices created by the installer and is a component of the path to the product shortcut in theWindows Start > All Programs menu. This name is referenced in documentation as ENV_NAME.

• Path The folder into which the product is installed. This folder is referenced in documentationas TIBCO_HOME. For example, on Windows systems the default value is C:\ProgramFiles\tibco\amx-3.

A TIBCO configuration folder stores configuration data generated by TIBCO products.Configuration data can include sample scripts, session data, configured binaries, logs, and so on.

CONFIG_HOME

This folder is referenced in documentation as CONFIG_HOME. On Windows platforms, the defaultlocation of the folder is userHome\Application Data\amx-3\data.

Code font identifies commands, code examples, filenames, pathnames, and output displayed in acommand window. For example:

code font

Use MyCommand to start the foo process.

Bold code font is used in the following ways:bold code font

• In procedures, to indicate what a user types. For example: Type admin.• In large code samples, to indicate the parts of the sample that are of particular interest.• In command syntax, to indicate the default parameter for a command. For example, if no

parameter is specified, MyCommand is enabled:

MyCommand [enable | disable]

Italic font is used in the following ways:italic font

• To indicate a document title. For example: See TIBCO BusinessWorks Concepts.• To introduce new terms. For example: A portal page may contain several portlets. Portlets are

mini-applications that run in a portal.• To indicate a variable in a command or code syntax that you must replace. For example:

MyCommand pathname

Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C.Key combinations

Key names separated by a comma and space indicate keys pressed one after the other. For example:Esc, Ctrl+Q.

The note icon indicates information that is of special interest or importance, for example, anadditional action required only in certain circumstances.

The tip icon indicates an idea that could be useful, for example, a way to apply the informationprovided in the current section to achieve a specific result.

TIBCO ActiveMatrix Service Bus Development Tutorials

Preface | 11

Page 12: Tib Amx Service Bus Development Tutorials

UseConvention

The warning icon indicates the potential for a damaging situation, for example, data loss orcorruption if certain steps are taken or not taken.

Table 2: Syntax Typographical Conventions

UseConvention

An optional item in command syntax.[ ]

For example:

MyCommand [optional_parameter] required_parameter

A logical ’OR’ that separates multiple items of which only one may be chosen.|

For example, you can select only one of the following parameters:

MyCommand param1 | param2 | param3

A logical group of items in a command. Other syntax notations may appear within each logicalgroup.

{ }

For example, the following command requires two parameters, which can be either the pair param1and param2, or the pair param3 and param4.

MyCommand {param1 param2} | {param3 param4}

In the next example, the command requires two parameters. The first parameter can be eitherparam1 or param2 and the second can be either param3 or param4:

MyCommand {param1 | param2} {param3 | param4}

In the next example, the command can accept either two or three parameters. The first parametermust be param1. You can optionally include param2 as the second parameter. And the last parameteris either param3 or param4.

MyCommand param1 [param2] {param3 | param4}

TIBCO ActiveMatrix Service Bus Development Tutorials

12 | Preface

Page 13: Tib Amx Service Bus Development Tutorials

Connecting with TIBCO Resources

How to Join TIBCOmmunity

TIBCOmmunity is an online destination for TIBCO customers, partners, and resident experts, a place to share and accessthe collective experience of the TIBCO community. TIBCOmmunity offers forums, blogs, and access to a variety ofresources. To register, go to http://www.tibcommunity.com.

How to Access All TIBCO Documentation

After you join TIBCOmmunity, you can access the documentation for all supported product versions here:http://docs.tibco.com/TibcoDoc.

How to Contact TIBCO Support

For comments or problems with this manual or the software it addresses, please contact TIBCO Support as follows:

• For an overview of TIBCO Support, and information about getting started with TIBCO Support, visit this site:

http://www.tibco.com/services/support

• If you already have a valid maintenance or support contract, visit this site:

https://support.tibco.com

Entry to this site requires a username and password. If you do not have a username, you can request one.

TIBCO ActiveMatrix Service Bus Development Tutorials

Preface | 13

Page 14: Tib Amx Service Bus Development Tutorials
Page 15: Tib Amx Service Bus Development Tutorials

Chapter

1Basic SOA Design Tutorials

Many of the steps in cheat sheets launch modal dialogs. Once a dialog is open, you cannot expand the view containingcheat sheet content. To ensure that you can see all the content, before opening a dialog you can expand the view so thatyou could see all of the cheat sheet content or you can detach the view so that it can be resized even while a dialog isopen.

Many TIBCO ActiveMatrix SOA development tutorials are distributed as cheat sheets in TIBCO Business Studio. To accessthe cheat sheets, start TIBCO Business Studio, select Help > Cheat Sheets... ,and expand the TIBCO SOA Developmentnode. For tutorials that are not cheat sheets, see the specific tutorial category.

To access the basic SOA design tutorials, expand the Basic folder.

• Create an SOA Project with an Empty Composite

Describes how to create an SOA project.

• Import Projects from an Archive

Describes how to import projects from an archive file.

• Import a WSDL File into an SOA Project

Describes how to import a WSDL file into an SOA project.

TIBCO ActiveMatrix Service Bus Development Tutorials

Page 16: Tib Amx Service Bus Development Tutorials
Page 17: Tib Amx Service Bus Development Tutorials

Chapter

2Mediation Tutorials

Many of the steps in cheat sheets launch modal dialogs. Once a dialog is open, you cannot expand the view containingcheat sheet content. To ensure that you can see all the content, before opening a dialog you can expand the view so thatyou could see all of the cheat sheet content or you can detach the view so that it can be resized even while a dialog isopen.

Many TIBCO ActiveMatrix SOA development tutorials are distributed as cheat sheets in TIBCO Business Studio. To accessthe cheat sheets, start TIBCO Business Studio, select Help > Cheat Sheets... ,and expand the TIBCO SOA Developmentnode. For tutorials that are not cheat sheets, see the specific tutorial category.

To access the mediation tutorials, expand the Mediation folder.

• How to Create and Package a Hello World Mediation Flow

Develop a simple Hello World application that returns an acknowledgment when a user submits a name to a SOAP client.

• How to Create and Package a Data Enrichment Mediation Flow

Use the Invoke Operation mediation task to enrich data in a mediation flow. The Invoke Operation task enables you toenhance message input, so that the message gathers additional data as it follows the mediation flow to the target operation.

• How to Create and Package a Content-Based Routing and Data Transformation Mediation Flow

Create a mediation flow that uses route tasks to send requests to service implementations in a sample Global DistributionSystem (GDS) travel service.

Table 3: Sample Project Location

Sample Project ArchivesCheat Sheet

TIBCO_HOME/amx_it_mediation/3.3/samples/HelloWorldHello World Mediation

• Create and Package

TIBCO_HOME/amx_it_mediation/3.3/samples/ContentBasedRouting

TIBCO_HOME/amx_it_mediation/3.3/samples/TargetService

Content-Based Routing andData Transformation

• Create and Package

TIBCO_HOME/amx_it_mediation/3.3/samples/DataEnrichmentData Enrichment MediationFlow

• Create and Package

TIBCO ActiveMatrix Service Bus Development Tutorials

Page 18: Tib Amx Service Bus Development Tutorials
Page 19: Tib Amx Service Bus Development Tutorials

Chapter

3Policy Tutorials

Several external policies require you to configure an attribute named resourceInstance. The value of that attribute is notan actual resource instance, but an application that references the required resource instance; the purpose of the application isto inject the resource instance into policies that require it.

When configuring these policies, you must first ensure that the appropriate application is deployed and running on the nodeswhere you will deploy the policy. To prepare the resource instance and application, see Preparing an Application that InjectsResource Instances into Policies on page 21.

To configure the policy to use the application, see Configuring the ResourceInstance Attribute in an External Policy on page20.

The location of the sample policies is TIBCO_HOME/amx/3.1/samples/policy/samples.zip

Topics

• Configuring the ResourceInstance Attribute in an External Policy• Preparing an Application that Injects Resource Instances into Policies

TIBCO ActiveMatrix Service Bus Development Tutorials

Page 20: Tib Amx Service Bus Development Tutorials

Configuring the ResourceInstance Attribute in an External Policy

Procedure

Several external policies require you to configure an attribute named resourceInstance. When configuring suchpolicies (by copying from the samples), replace the sample value of the resourceInstance attribute with theactual name of the application that references (and injects) the appropriate resource instance.

TIBCO ActiveMatrix Service Bus Development Tutorials

20 | Policy Tutorials

Page 21: Tib Amx Service Bus Development Tutorials

Preparing an Application that Injects Resource Instances into Policies

Procedure

1. Create resource templates of the required types:

Required Resource TemplatesPolicy

Identity ProviderSigning or Decryption

Keystore Provider

Trust ProviderSignature Verification or Encryption

Keystore Provider

Mutual Identity ProviderBoth of the above

Keystore Provider

WS-Security ASPWssProvider or WssConsumer

LDAP Authentication ProviderLDAP for authentication

2. Create a resource instance from each template.

3. Create governance agent applications that reference the resource instances (one application per resource instance):

Application Template DAA NameApplication TemplateResourceInstance Type

com.tibco.governance.sharedresource.ldap.asp.daaTIBCO ActiveMatrixGovernance Agent LDAP

LDAPAuthenticationProvider Authentication Provider App

Template

com.tibco.governance.sharedresource.mutual.isp.daaTIBCO ActiveMatrixGovernance Agent Mutual

Mutual IdentityProvider

Identity Provider AppTemplate

com.tibco.governance.sharedresource.subject.isp.daaTIBCO ActiveMatrixGovernance Agent IdentityProvider App Template

Identity Provider

com.tibco.governance.sharedresource.trust.isp.daaTIBCO ActiveMatrixGovernance Agent TrustProvider App Template

Trust Provider

com.tibco.governance.sharedresource.wss.asp.daaTIBCO ActiveMatrixGovernance Agent WSS

WS-Security ASP

Authentication Provider AppTemplate

4. Distribute the applications to the appropriate nodes and run them. Each application that injects a resource instancemust run on every node where a policy requires that resource instance.

TIBCO ActiveMatrix Service Bus Development Tutorials

Policy Tutorials | 21

Page 22: Tib Amx Service Bus Development Tutorials

5. Each application type has a single property that you must set. In the Properties tab of the application, specify theresource instance name as the value of that property.For example, the Trust Provider application has a property named TrustIspConnectionFactory. Set its valueto the name of the resource instance that this application injects into policies.

TIBCO ActiveMatrix Service Bus Development Tutorials

22 | Policy Tutorials

Page 23: Tib Amx Service Bus Development Tutorials

Glossary

OpenTopic | Glossary | 23

Page 24: Tib Amx Service Bus Development Tutorials

24 | OpenTopic | Glossary