TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF...

40
TIBCO ActiveMatrix ® Management Agent for WCF Samples Software Release 1.2.0 July 2009

Transcript of TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF...

Page 1: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

TIBCO ActiveMatrix®

Management Agent for WCF

SamplesSoftware Release 1.2.0July 2009

Page 2: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED 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 LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE 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 part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc.TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, TIBCO ActiveMatrix BusinessWorks, TIBCO Administrator, TIBCO Runtime Agent, TIBCO Enterprise Message Service, TIBCO Designer, TIBCO ActiveMatrix, TIBCO ActiveMatrix Policy Manager are either registered trademarks or 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 and are mentioned for identification purposes only.THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM.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 A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN 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 TO ANY RELEASE NOTES AND "READ ME" FILES.Copyright © 2008-2009 TIBCO Software Inc. ALL RIGHTS RESERVED.TIBCO Software Inc. Confidential Information

Page 3: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

| iii

Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viTIBCO ActiveMatrix Management Agent for WCF Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viOther TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viThird Party Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi

Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii

How to Contact TIBCO Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

Chapter 1 Sample Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Installing and Configuring the Snap-in Server Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Adding Management Agent for WCF Snap-in to Microsoft Management Console. . . . . . . . . . . . . . . . . . . . . 4Configuring Management Agent for WCF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Starting the Agent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Managing Sample Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Deploy the Sample Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Manage the Sample Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Apply the ’Logging Policy’ to the Sample Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Run TIBCO ActiveMatrix BusinessWorks Project and Test Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Confirm Policy Enforcement Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Chapter 2 WCF Service Probe Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Prerequisites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Locating Tutorial and Loading the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Creating Custom Metrics, Custom Action, Rule Packages, Objectives, and Rules . . . . . . . . . . . . . . . . . . . . . . . 24

Testing the Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Monitoring Service in Dashboards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 4: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

iv | Contents

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 5: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

| v

Preface

TIBCO ActiveMatrix® Management Agent for WCF extends policy management to web services deployed using Microsoft WCF (Windows Communication Foundation) in IIS (Microsoft Internet Information Services) Server. The management agent is a plug-in component within WCF components, and cooperates with TIBCO ActiveMatrix Policy Manager.

Readers of this document must already be familiar with TIBCO ActiveMatrix Policy Manager software and with Windows Communication Foundation (WCF) software.

Topics

• Related Documentation, page vi

• Typographical Conventions, page viii

• How to Contact TIBCO Support, page x

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 6: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

vi | Related Documentation

Related Documentation

This section lists documentation resources you may find useful.

TIBCO ActiveMatrix Management Agent for WCF DocumentationThe following documents form the TIBCO ActiveMatrix Management Agent for WCF documentation set:

• TIBCO ActiveMatrix Management Agent for WCF Installation This book presents instructions for installing the product.

• TIBCO ActiveMatrix Management Agent for WCF User’s Guide This book describes ActiveMatrix Management Agent for WCF software, and presents instructions for configuring and using the product.

• TIBCO ActiveMatrix Management Agent for WCF Samples This book includes instructions for sample example that is included in the release.

• TIBCO ActiveMatrix Policy Agent Samples This document presents instructions for demonstrating examples, which are included in the release.

• TIBCO ActiveMatrix Management Agent for WCF Release Notes Read the release notes for a list of new and changed features. This document also contains lists of known issues and closed issues for this release.

Other TIBCO Product DocumentationYou may find it useful to read the documentation for the following TIBCO products:

• TIBCO ActiveMatrix® Policy Manager

• TIBCO EMS Transport Channel for WCF

• TIBCO ActiveMatrix® Service Grid

• TIBCO ActiveMatrix® Registry

• TIBCO Enterprise Message Service™

• TIBCO Administrator™

Third Party Documentation

Microsoft IIS 6.0Documentation

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/003ed2fe-6339-4919-b577-6aa965994a9b.mspx?mfr=true

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 7: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Preface | vii

Microsoft WCFDocumentation

http://msdn.microsoft.com/en-us/library/aa388579(vs.85).aspx

Web ServicesStandards

Management Agent for WCF supports web services standards sponsored by the following standards bodies:

• World Web Web Consortium web services activityhttp://www.w3.org/2002/ws/

— WSDL 1.1 Note http://www.w3.org/TR/wsdl

— WSDL 2.0 Working Drafts http://www.w3.org/2002/ws/desc/

• OASIS web services committeeshttp://www.oasis-open.org/committees/tc_cat.php?cat=ws

• Web Services Interoperability http://www.ws-i.org/

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 8: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

viii | Typographical Conventions

Typographical Conventions

The following typographical conventions are used in this manual.

Table 1 General Typographical Conventions

Convention Use

TIBCO_HOME All TIBCO products are installed under the same directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\tibco.

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

Use MyCommand to start the foo process.

bold code

font Bold code font is used in the following ways:

• 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 Italic font is used in the following ways:

• To indicate a document title. For example: See TIBCO ActiveMatrix 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 combinations

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

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, an additional action required only in certain circumstances.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 9: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Preface | ix

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

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

Table 1 General Typographical Conventions (Cont’d)

Convention Use

Table 2 Syntax Typographical Conventions

Convention Use

[ ] An optional item in a command or code 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 para1 | param2 | param3

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

For example, the following command requires two parameters, which can be either the pair param1 and 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 either param1 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 parameter must be param1. You can optionally include param2 as the second parameter. And the last parameter is either param3 or param4.

MyCommand param1 [param2] {param3 | param4}

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 10: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

x | How to Contact TIBCO Support

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 user name and password. If you do not have a user name, you can request one.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 11: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

| 1

Chapter 1 Sample Examples

This chapter describes the examples and the sample kit, and provides step by step tasks that you must complete for running the examples.

Topics

• Contents, page 2

• Tasks, page 3

• Installing and Configuring the Snap-in Server Resources, page 4

• Managing Sample Service, page 11

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 12: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

2 | Chapter 1 Sample Examples

Contents

The samples contains the following items:

• Sample WCF Service named HelloGoodbye

• BusinessWorks Project

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 13: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Tasks | 3

Tasks

There are no utilities packaged with WCF agent. All configuration tasks are handled from the Management Agent for WCF snap-in for Microsoft Management Console.

This example demonstrates the following tasks:

• Installing and Configuring the Snap-in Server Resources

— Adding Management Agent for WCF Snap-in to Microsoft Management Console

— Configuring Management Agent for WCF

— Starting the Agent

• Managing Sample Service

— Deploy the Sample Service

— Manage the Sample Service

— Apply the ’Logging Policy’ to the Sample Service

— Run TIBCO ActiveMatrix BusinessWorks Project and Test Policy

— Confirm Policy Enforcement Results

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 14: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

4 | Chapter 1 Sample Examples

Installing and Configuring the Snap-in Server Resources

This is a post-installation task and needs to be performed only once.

To install server resources provided by Management Agent for WCF snap-in, perform the following steps:

1. Open the command prompt and navigate to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

2. Install the Snap-in by executing the command:

InstallUtil TIBCO_HOME\amma-wcf\<version_num>\bin\Tibco.PolicyAgent.SnapIn.dll

3. Make sure that the Snap-in is installed properly by inspecting the installation logs in the TIBCO_HOME\amma-wcf\<version_num>\bin folder.

Adding Management Agent for WCF Snap-in to Microsoft Management ConsoleOnce installed, you can launch the Snap-in by performing the following steps:

1. To launch Microsoft Management Console (MMC):

a. Select Start > Run.

b. Enter mmc.

A management console window is displayed.

2. To add the Snap-in for policy agent, select File -> Add/Remove Snap-in….

An Add/Remove Snap-in window is displayed.

3. Press Add on the Standalone tab.

The Add Standalone Snap-in window is displayed.

4. From the list of snap-ins, select TIBCO AMMA for WCF and click OK.

5. After the Policy Agent snap-in is launched for the first time, it can be saved as a MMC document file as follows:

a. Select File > Save As.

b. Navigate to the TIBCO_HOME\amma-wcf\<version_num>\bin directory.

c. Enter the file name Tibco.PolicyAgent.SnapIn.msc.

d. Click Save.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 15: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Installing and Configuring the Snap-in Server Resources | 5

You can launch the Snap-in for Policy Agent next time by double-clicking the Tibco.PolicyAgent.SnapIn.msc file in TIBCO_HOME\amma-wcf\<version_num>\bin.

Configuring Management Agent for WCFTo launch TIBCO ActiveMatrix Management Agent for WCF Snap-in in MMC:

1. Open the TIBCO_HOME\amma-wcf\<version_num>\bin folder.

2. Double-click Tibco.PolicyAgent.SnapIn.msc.

TIBCO Management Agent for WCF Console appears as shown below.

Figure 1 Management Agent for WCF Console

— AMMA WCF Agent Instances

— Policy Agent Configuration

— Policy Agent Instances

Before starting TIBCO ActiveMatrixManagement Agent for WCF, you need to configure it using the Policy Agent Configuration option.

3. Click Policy Agent Configuration in the left pane and specify the following configuration details.

4. In Database Configuration, enter values for the following database configuration parameters:

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 16: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

6 | Chapter 1 Sample Examples

Figure 2 Database Configuration

a. Select OleDbConnection as the default DB Driver to access the database.

b. Specify the following Connection parameters to connect to a database:

Provider—Enter the database connection name.

DataSource—Specify the database server name.

Initial Catalog—Enter the name of the database that can be used with Management Agent for WCF.

DB User—Specify the user name to connect to the database.

Password—Specify the password to authenticate the DB User.

5. Click Update Config to update the values for database configurations.

6. Click Register to register the message inspection library to GAC.

Figure 3 Register Policy Agent To GAC

7. Click Update to update the MACHINE.CONFIG to use the message inspection library.

Keep the Initial Catalog field empty if you are using Oracle.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 17: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Installing and Configuring the Snap-in Server Resources | 7

Figure 4 Update MACHINE Config

The WCF Agent Library for Message Inspector enables the Management Agent for WCF to intercept and process request/reply messages for a WCF service.

8. In the left pane, expand the TIBCO AMMA for WCF folder.

9. Select AMMA WCF Agent and right-click.

Figure 5 Add Instance from MMC Snap-in

10. Select Add Instance from the popup menu.

A new instance named ’Added <current time>’ is added under the AMMA WCF Agent folder in the left pane.

11. Select the ’Added <current time>’ agent instance from the left pane and right-click.

12. Select Rename from the popup menu and enter default as the instance name.

13. Select default instance in the left pane.

14. In WCF Policy Agent Instance Details, specify the values for the following configuration parameters:

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 18: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

8 | Chapter 1 Sample Examples

Figure 6 WCF Policy Agent Instance Details

a. Make sure that TIBCO ActiveMatrix Policy Manager is running.

b. Enter the machine name in the Policy Manager Machine Name field on which TIBCO ActiveMatrix Policy Manager is running.

c. Enter the socket port used by the Policy Manager services in the Policy Manager Port field.

d. Enter the socket port used by the management service of Management Agent for WCF in the Agent Port field.

e. Provide the security permission to the agent port. See the section ’WCF Custom Security Permissions’ in Chapter 1- Introduction of TIBCO ActiveMatrix Management Agent for WCF User’s Guide.

f. Specify the cache directory for Management Agent for WCF in the Cache Dir field. You can Browse and select a directory to be used as the cache directory.

g. Using the IIS Manager, select the virtual directory under the default website. Specify virtual directory alias as WCFServices and path as C:\Inetpub\wwwroot\WCFServices directory.

h. In the Service Location field, specify the IIS Virtual Directory location (for example, http://localhost:80/WCFServices).

i. Shared Secret is an optional parameter and enables only after an agent is configured. Set this parameter only after you set and update the above

Before configuring the agent, make sure the WCF service is deployed in the IIS server. (See Deploy the Sample Service on page 11). You can not configure the agent with an empty virtual directory.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 19: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Installing and Configuring the Snap-in Server Resources | 9

configuration parameters. The shared secret enables a set of policy components to communicate with one another without interfering with other sets of policy components.

j. Click the Update Config button.

Starting the AgentTo initialize the Management Agent for WCF, you need to first query the sample web services hosted in the virtual directory on IIS.

To initialize the agent, run the following query: http://machine_name:port_number/virtual_directory/service_name.src?wsdl

If the query is successful, the WSDL is displayed which means the Management Agent for WCF has started.

To verify the status of the Agent,

1. Open the Policy Manager Console.

2. Configure Full Query to Show Services that are Amberpoint > Agent. Click Go. In the left panel of Policy Manager, the WCF Agent is displayed with a green sphere.

The shared secret parameter is used to communicate with Policy Manager. The value of shared secret must be identical to the shared secret value that you supplied to Policy Manager. See the TIBCO ActiveMatrix Management Agent for WCF User’s Guide for details.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 20: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

10 | Chapter 1 Sample Examples

Figure 7 Policy Manager Console

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 21: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Managing Sample Service | 11

Managing Sample Service

After you complete Installing and Configuring the Snap-in Server Resources, you can perform this exercise to:

• Manage a service using Management Agent for WCF

• Apply Logging policy

Task A Deploy the Sample Service

1. Unzip the content of WCFServices.zip file to TIBCO_HOME\amma-wcf\<version_num>\samples.

2. Copy the contents of WCFServices folder to the virtual directory.

3. Open Internet Explorer.

4. Confirm service deployment by specifying the following URL in the browser:http://localhost/WCFServices/HelloGoodbyeService.svc?wsdl

Task B Manage the Sample Service

1. Make sure that the following applications are running:

— Policy Manager Server

— Management Agent for WCF

2. Launch Management Agent for WCF snap-in by double-clicking the Tibco.PolicyAgent.SnapIn.msc file in TIBCO_HOME\amma-wcf\<version_num>\bin directory.

3. Expand the TIBCO AMMA for WCF > AMMA WCF Agent Instances folder in the left pane.

4. Select the agent instance named default.

5. In the Manage Services dialog in the right pane, specify Service WSDL Location as:

http://localhost/WCFServices/HelloGoodbyeService.svc?wsdl

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 22: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

12 | Chapter 1 Sample Examples

Figure 8 Manage Services

6. Click the Manage button.

7. To confirm that the service is managed, follow these steps:

a. Log into Policy Manager console.

b. Click on Services menu option.

Figure 9 Policy Manager Console > Services

The managed service is displayed in the Services panel.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 23: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Managing Sample Service | 13

Task C Apply the ’Logging Policy’ to the Sample Service

1. Log into Policy Manager console.

2. Click on Services menu option.

The managed services are displayed in Services pane.

3. Select HelloGoodbyeService from the left-side pane.

4. Select Add Policy > Logging > Message History > Diagnostics button from the Policies tab.

Figure 10 Policy Manager Console > Apply Policy

5. On the Add Policy screen, accept the default settings.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 24: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

14 | Chapter 1 Sample Examples

Figure 11 Policy Manager Console > Add Policy

The Logging policy is applied to the sample service.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 25: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Managing Sample Service | 15

Task D Run TIBCO ActiveMatrix BusinessWorks Project and Test Policy

1. Launch TIBCO Designer and open the WCFServicesBWClient project from TIBCO_HOME\amma-wcf\<version_num>\samples folder.

2. Expand the WSDL folder in the left pane and make sure that the HelloGoodbyeService is imported.

Figure 12 BW Project > WSDL

3. Expand the Processes folder in the left pane and check the client configurations:HelloGoodbyeService - Hello Method

HelloGoodbyeService - Goodbye Method

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 26: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

16 | Chapter 1 Sample Examples

Figure 13 BW Project > Processes

Select SoapRequestReply > Transport Details tab and check the Endpoint URL. The Endpoint URL should match with the service URL that is displayed in the Policy Manager console > Services > Structure tab > Endpoint Details URL.

4. Save the project and then run HelloGoodbyeService - Goodbye Method process.

5. Make sure that the Request is passed successfully.

Task E Confirm Policy Enforcement Results

1. Log into Policy Manager console.

2. Click on Services menu option.

The managed services are displayed in Services pane.

3. Select HelloGoodbyeService from the left-side pane.

4. Click on Log tab.

5. Select all the operations for HelloGoodbyeService.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 27: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Managing Sample Service | 17

6. Click the Get Results button to query log records.

Figure 14 HelloGoodByeService

Observe that all the inbound and outbound messages to the service are getting logged.

To apply any policy other than the Logging policy, the sample BusinessWorks Project also provides the configurations to test all the other policy types. However, you may need to update some parameters for testing some policy types.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 28: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

18 | Chapter 1 Sample Examples

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 29: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

| 19

Chapter 2 WCF Service Probe Tutorial

This chapter describes the example and the sample kit, and provides step by step tasks that you must complete for running the examples.

Topics

• Overview, page 20

• Tutorial Overview, page 21

• Locating Tutorial and Loading the Data, page 22

• Creating Custom Metrics, Custom Action, Rule Packages, Objectives, and Rules, page 24

• Testing the Services, page 26

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 30: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

20 | Chapter 2 WCF Service Probe Tutorial

Overview

This tutorial introduces you to the basic capabilities of the WCF Service Probe present in TIBCO ActiveMatrix Management Agent for WCF. The scenarios covered by the tutorial are as follows:

7. Monitor WCF services, triggering email alerts when certain conditions are met.

8. Create SLAs (Rules and Rule Packages) for WCF services with different objectives

Prerequisites

Before you begin this tutorial, make sure that you have installed and configured all the prerequisite software on your system.

TIBCO ActiveMatrix Service Performance Manager Server Installation

Use the TIBCO ActiveMatrix Service Performance Manager Installation guide to install and start the ActiveMatrix Service Performance Manager services.

For Sending and Receiving Email Alerts

You can set up Java Apache Mail Enterprise Server (JAMES) as the mail server. You must have connection information for an email server (SMTP server) to send emails. You also need to have an email client that can receive emails from this SMTP server.

Create email aliases for the following users:

• spmadmin (user)

Make sure that the TIBCO ActiveMatrix Service Performance Manager and TIBCO ActiveMatrix Management Agent for WCF are installed on the same machine for running the tutorial.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 31: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Tutorial Overview | 21

Tutorial Overview

The TIBCO ActiveMatrix Management Agent for WCF tutorial contains a set of command files that enable you to populate the required data. The tutorial includes a predefined project created in WCF for the Book Order service. The services in the project can be monitored from TIBCO ActiveMatrix Service Performance Manager.

This tutorial will guide you through the step by step process of:

• Locating Tutorial and Loading the Data, page 22

• Creating Custom Metrics, Custom Action, Rule Packages, Objectives, and Rules, page 24

• Testing the Services, page 26

• Monitoring Service in Dashboards, page 30

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 32: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

22 | Chapter 2 WCF Service Probe Tutorial

Locating Tutorial and Loading the Data

To set up the tutorial procedure on the TIBCO ActiveMatrix Management Agent for WCF, do the following:

1. Before you begin, make sure that ActiveMatrix Service Performance Manager is properly installed and the following services are running:

— TIBCO Enterprise Message Service

— The default HSQL database server (or external database server)

— TIBCO ActiveMatrix Administrator

— TIBCO ActiveMatrix Management Daemon services

— SPM system node

2. Locate the tutorial in the following path:TIBCO_AMMA-WCF_HOME\samples\WCFBookOrderSample.zip

where,TIBCO_AMMA-WCF_HOME = TIBCO_ActiveMatrix_HOME\amma-wcf\<version_number>

3. Extract the zip file to TIBCO_AMMA-WCF_HOME\samples.

Note that the tutorial contains the following folders:

BookOrderSample\bin: Contains the Service and Native Client executables, configuration file and DLL's. This folder includes the includes BookOrder and ReOrderBook services.

BookOrderSample\source: Contains the source code for the sample services.

BookOrderSample\test: Bundles the SOAP UI project to test the services.

4. Start the StandAloneServiceHost.exe from TIBCO_AMMA-WCF_HOME\samples\bin.

5. Browse to script folder: cd TIBCO_SPM_HOME\tutorial\scripts

where TIBCO_SPM_HOME=TIBCO_ActiveMatrix_HOME\spm\<version_number>

Verify in Event Viewer > Tibco.SPM.ServiceProbe, WCF service probe started on [ Windows Console Application/ServiceStandAloneHost.exe ] is visible.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 33: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Locating Tutorial and Loading the Data | 23

6. Open login.properties and tutorialsetup_data.properties and verify values set for all the user ids, passwords, ports, etc. Edit the values for the required properties as per your environment.

7. To configure schedules and roles, run the following command from the TIBCO_SPM_HOME\tutorial\scripts folder:TIBCO_SPM_HOME\bin\spmcmdline.bat tutorial_build.xml

This step loads schedules and custom metrics, and initializes the users.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 34: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

24 | Chapter 2 WCF Service Probe Tutorial

Creating Custom Metrics, Custom Action, Rule Packages,

Objectives, and Rules

Using the TIBCO ActiveMatrix Service Performance Manager, you can now add custom metrics, custom action, rule packages and objectives to monitor and manage the BookOrder services.

1. Open the tutorial_build.xml file located under TIBCO_SPM_HOME\tutorial\scripts folder for edit.

Search for line: <target name="load-wcf-customaction-custommetrics"> and insert <exec executable="hostname" outputproperty="machineName"/> after it and save the file.

2. To create all the custom metrics, custome action, rule packages, objectives, and rules through CLI, run the following command from TIBCO_SPM_HOME\tutorial\scripts:TIBCO_SPM_HOME\bin\spmcmdline.bat tutorial_build.xml load-tutorial-wcf-rules

AccessingActiveMatrix

Administrator

1. Open your browser’s address box and enter a URL of the following format: http://<hostname>:<port>/amxadministrator

For example: http://amxserver.acme.com:8120/amxadministrator.

or

Select All Programs > TIBCO > TIBCO ActiveMatrix > Administrator Servers. You see an ActiveMatrix Administrator server named admin installed on the local machine.

2. Click the admin domain and provide user credentials:

— Username: spmadmin

— Password: tibco

3. Click the Build and Configure Rules perspective in TIBCO ActiveMatrix Administrator.

It opens the Rule Package Library.

4. In the Rule Package Library, select the following rule packages and click Enable:

— WebuserSLA:generic

— PublisherSLA:McGraw-Hill

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 35: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Creating Custom Metrics, Custom Action, Rule Packages, Objectives, and Rules | 25

5. Click the Rules link in the top bar to ensure that all the rules contained in the enabled rule packages are also enabled.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 36: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

26 | Chapter 2 WCF Service Probe Tutorial

Testing the Services

For testing the web services, you can use the soapUI tool that is available for free download at www.soapui.org.

For Testing the Response Time Specific Objectives

Follow these steps to test the objectives specific to response time:

— Responsetime:generic:webuser

— Responsetime:Publisher:McGraw-Hill

1. Download soapUI-2.0.2-installer.exe and install the product.

2. Run soapUI 2.0.2.

Figure 15 soapUI Tool

3. Click File > Import Project and select TIBCO_AMMA-WCF_HOME\samples\WCFBookOrderSample\test\tutorial-bo

okorderservice-soapui-project.xml

4. Click Open.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 37: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Testing the Services | 27

Figure 16 Tutorial Tester

BookOrderPT_EP TestSuite for WCF—Invokes the WCF BookOrder service.

5. To load the WCF services, expand the folder BookOrderPT_EP TestSuite for WCF as shown in the following figure.

Figure 17 TestSuite for WCF

a. Double-click LoadTest1.

b. Click the green arrow head to run the test as shown in the following figure.

Figure 18 Load Test 1

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 38: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

28 | Chapter 2 WCF Service Probe Tutorial

Loading the BookOrder service will trigger the following rules when the response time condition defined in each rule is met:

• ResponsetimeRule:generic:webuser

• ResponsetimeRule:Publisher-McGrawHill

You can monitor the data related to triggered rules in the Rules and Services Dashboard in the View and Manage Dashboard perspective. See Monitoring Service in Dashboards in TIBCO ActiveMatrix Service Performance Manager User Guide for more details.

For Testing the Objective—RestockBooks:publisher:McGraw-Hill

When you run LoadTest1, the orderBook test sends 100 requests for the book "Age of Innovation". To know details about the test, double-click orderBook from the Test Step column to view the following test details.

Figure 19 orderBook Test Details

This will trigger the RestockBooksRule:AgeofInnovation rule which will invoke the associated custom action RestockBooksWCF. To see whether the RestockBookWCF action is invoked, check the console where the ServiceStandAloneHost service is running as shown in Figure 20.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 39: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

Testing the Services | 29

Figure 20 ServiceStandAloneHost exe

For Testing the Objectives - Availability:publisher:Mcgraw-Hill

Follow these steps to test the following objective specific to availability of online services:

— Availability:publisher:Mcgraw-Hill

1. Hit the Return key and Ctrl + C in the console where the ServiceStandAloneHost service is running.

Stopping the service will stop the ’onlineservices’. This will drop the availability of ’onlineservices’ services. When the service availability becomes less than 99.2%, the condition defined in the Availability99Rule:wcf rule will be satisfied and the rule will be triggered.

TIBCO ActiveMatrix Management Agent for WCF Samples

Page 40: TIBCO ActiveMatrix Management Agent for WCF Samples · TIBCO ActiveMatrix Management Agent for WCF Samples |v Preface TIBCO ActiveMatrix® Management Agent for WCF extends policy

30 | Chapter 2 WCF Service Probe Tutorial

Monitoring Service in Dashboards

TIBCO ActiveMatrix Service Performance Manager provides default views for you to monitor the rules or services performance data. See Monitoring Service in Dashboards in TIBCO ActiveMatrix Service Performance Manager User Guide for more details.

TIBCO ActiveMatrix Management Agent for WCF Samples