Documentation

##### WSO2 WSAS 2.2-RC1

- Release Notes
- Contents
- Home

##### Downloads

- Releases

##### Documentation

- User Guide
- FAQs
- Installation Guide
- Source
- Running Behind a Proxy
- Data Services Guide
  - RDBMS Data Source
  - CSV Data Source
  - Excel Data Source
  - JNDI Data Source
- EJB Guide
- Clustering Guide
- JMX Guide
- XKMS Guide
- Changing Keys

##### Samples

- Chad
- Commodity Quote
- Data Services
- Flickr
- Javascript
- Jaxws
- JiBX
- Mtom
- STS
- Trader
- Tiny URL
- Metadata Exchange
- WS-Transfer
- XML Key Managment Specification
- Cluster Management

##### API Documentation

- Java Docs

##### Tools

- Code Generation
- Change Password
- Eclipse IDE Integration
- TCP Monitor
- WSDL2Code
- WSDL View
- Try It
- AAR Validation
- MAR Validation

##### Resources

- News

##### Get Involved

- Mailing Lists
- Integration

##### Project Information

- Project Team
- Issue Tracking
- License

[Download] | [Documentation Home] | [Release Note]

# TCPMon Guide

The aim of this simple tutorial is to explain how the TCPMon works. It explains how messages are exchanged and other important features such as Slow Connection Simulation and HTTP Proxy Support.

## Content

- Introduction
- Structure and Dependencies
- Usage Patterns
  - As an Explicit Intermediate
  - As a Request Sender for Web Services
  - As a Proxy
- Advanced Settings
  - Slow Connection Simulation
  - HTTP Proxy support
- Conclusion

## Introduction

TCPMon is a utility that allows the user to monitor the messages passed along in a TCP based conversation. It is based on a swing UI and works on almost all the platforms that Java supports. The script file, tcpmon.{sh|bat} to run this tool is located in the "bin" folder of the WSO2 WSAS distribution.

## Structure and Dependencies

TCPMon has absolutely no dependencies on third party libraries. TCPMon needs a JRE that is 1.4 or higher.

## Usage Patterns

### As an Explicit Intermediate

The most common usage pattern for the TCPMon is as an intermediary. It is called explicit since the client has to send the messages to the intermediary rather than to the original endpoint in order to monitor the messages. The following figure explains this concept.
In order to start the TCPMon in this configuration, you have to provide the target host name and port as well as the listening port on the Admin tab. See the image below.
Click 'Add' to open a new tab that displays the messages to be seen, as displayed in the following screen.
At this point, the requester should point to the listener port of the TCPMon instead of the original endpoint. Let us understand this with an example: For example, we need to monitor all the messages that are sent to and from www.apache.org.

Step 1 - Add a listener with the host as www.apache.org and port as 80. Set the listener to port 8080, which may be any unused port in the local machine.

Step 2 - Point the browser to the localhost:8080 instead of www.apache.org.

Once the exchange of messages start, they can be seen on the relevant tab as seen below.

The options at the bottom of the screen can be used to have the messages in XML format (useful in debugging Web services), save and resend the messages, and also to switch the layout of the message windows.

### As a Request Sender for Web Services

TCPMon can also be used as a request sender for Web services. The request SOAP message can be pasted on the send screen and then sent directly to the server.

### As a Proxy

TCPMon can act as a proxy. To start the TCPMon in proxy mode, just select the Proxy option. When acting as a proxy, TCPMon only needs the listener port to be configured.

## Advanced Settings

### Slow Connection Simulation

TCPMon can simulate a slow connection, in which case the delay and the bytes to be dropped can be configured. This is specially useful in testing Web services.

### HTTP Proxy support

If HTTP proxy support is required, then that can also be set on the admin screen.

## Conclusion

TCPMon is a simple and easy to use tool that has many benefits when developing message driven applications. It is particularly useful in developing Web services.

###