You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Tony Blair <hr...@yahoo.com> on 2004/02/09 23:03:44 UTC

SoapMonitorApplet

Hi,
 
I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?
 
Thanks,
Tony.


---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: SoapMonitorApplet

Posted by Dhanush Gopinath <dh...@mahindrabt.com>.
It wont be there in the jars in lib. Lib contains only the jars thats needed for Axis APIs.

I dunno whats your problem. May be any installation problem.

Dhanush
  ----- Original Message ----- 
  From: Tony Blair 
  To: axis-user@ws.apache.org 
  Sent: Tuesday, February 10, 2004 7:26 PM
  Subject: Re: SoapMonitorApplet

  Thanks Dhanush, I do not find the SoapMonitorApplet.java anywhere in the axis-home. I even looked in the jar files in the lib dir.

  Thanks,
  Tony.

  Dhanush Gopinath <dh...@mahindrabt.com> wrote:

    Hi Tony,

    The SoapMonitorApplet will be there in this folder.

    axis-home\webapps\axis

    To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.

    Cheerio

    Dhanush
      ----- Original Message ----- 
      From: Tony Blair 
      To: axis-user@ws.apache.org 
      Sent: Tuesday, February 10, 2004 3:33 AM
      Subject: SoapMonitorApplet

      Hi,

      I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?

      Thanks,
      Tony.

--------------------------------------------------------------------------
      Do you Yahoo!?
      Yahoo! Finance: Get your refund fast by filing online

    *********************************************************
    Disclaimer

    This message (including any attachments) contains 
    confidential information intended for a specific 
    individual and purpose, and is protected by law. 
    If you are not the intended recipient, you should 
    delete this message and are hereby notified that 
    any disclosure, copying, or distribution of this
    message, or the taking of any action based on it, 
    is strictly prohibited.

    *********************************************************
    Visit us at http://www.mahindrabt.com

------------------------------------------------------------------------------
  Do you Yahoo!?
  Yahoo! Finance: Get your refund fast by filing online

*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com


Re: SoapMonitorApplet

Posted by Tony Blair <hr...@yahoo.com>.
Hi,

Which line in the web.xml needs to be commented? I have tried the following:
 
If I comment out the :
<!--  <servlet-mapping>
    <servlet-name>SOAPMonitorService</servlet-name>
    <url-pattern>/SOAPMonitor</url-pattern>
  </servlet-mapping>  -->
This doesn't work. I get HTTP 404 after restarting the Tomcat and pointing the browser to "http://localhost:8080/axis/SOAPMonitor".
 
If I comment out :
<!--  <servlet>
    <servlet-name>SOAPMonitorService</servlet-name>
    <display-name>SOAPMonitorService</display-name>
    <servlet-class>
        org.apache.axis.monitor.SOAPMonitorService
    </servlet-class>
    <init-param>
      <param-name>SOAPMonitorPort</param-name>
      <param-value>5001</param-value>
    </init-param>
    <load-on-startup>100</load-on-startup>
  </servlet>   -->
 
Tomcat throws several exception and the stack trace is so large that I can't past it here.

If I don't comment anything in the web.xml then the SoapMonitorApplet works fine but I don't see any soap traffic when running my web service client. Any idea?
 
Thanks,
Tony.

Venkatesh Kancharla <ve...@strandgenomics.com> wrote:
Hi Tony,
SOAPMonitorApplet comes with axis installation itself and is
located at webapps/axis/ directory. Anyways Iam attaching that file. 

regards
venkatesh

On Tue, 10 Feb 2004, Tony Blair wrote:

> Thanks Dhanush, I do not find the SoapMonitorApplet.java anywhere in
> the axis-home. I even looked in the jar files in the lib dir.
> 
> Thanks,
> Tony.
> 
> Dhanush Gopinath wrote:
> 
> Hi Tony,
> 
> The SoapMonitorApplet will be there in this folder.
> 
> axis-home\webapps\axis
> 
> To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.
> 
> Cheerio
> 
> Dhanush
> ----- Original Message ----- 
> From: Tony Blair 
> To: axis-user@ws.apache.org 
> Sent: Tuesday, February 10, 2004 3:33 AM
> Subject: SoapMonitorApplet
> 
> 
> Hi,
> 
> I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?
> 
> Thanks,
> Tony.
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
> *********************************************************
> Disclaimer
> 
> This message (including any attachments) contains 
> confidential information intended for a specific 
> individual and purpose, and is protected by law. 
> If you are not the intended recipient, you should 
> delete this message and are hereby notified that 
> any disclosure, copying, or distribution of this
> message, or the taking of any action based on it, 
> is strictly prohibited.
> 
> *********************************************************
> Visit us at http://www.mahindrabt.com
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
*/

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;

import org.apache.axis.monitor.SOAPMonitorConstants;

/**
* This is a SOAP Mointor Applet class. This class provides
* the user interface for displaying data from the SOAP
* monitor service.
*
* @author Brian Price (pricebe@us.ibm.com)
*
*/
public class SOAPMonitorApplet extends JApplet {

/**
* Private data
*/
private JPanel main_panel = null;
private JTabbedPane tabbed_pane = null;
private int port = 0;
private Vector pages = null;

/**
* Constructor
*/
public SOAPMonitorApplet() {
}

/**
* Applet initialization
*/
public void init() {
// Get the port to be used
String port_str = getParameter("port");
if (port_str != null) {
port = Integer.parseInt(port_str);
}
// Try to use the system look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e){
}
// Create main panel to hold notebook
main_panel = new JPanel();
main_panel.setBackground(Color.white);
main_panel.setLayout(new BorderLayout());
setContentPane(main_panel);
// Create the notebook
tabbed_pane = new JTabbedPane(JTabbedPane.TOP);
main_panel.add(tabbed_pane,BorderLayout.CENTER);
// Add notebook page for default host connection
pages = new Vector();
addPage(new SOAPMonitorPage(getCodeBase().getHost()));
}

/**
* Add a page to the notebook
*/
private void addPage(SOAPMonitorPage pg) {
tabbed_pane.addTab(" "+pg.getHost()+" ", pg);
pages.addElement(pg);
}

/** 
* Applet is being displayed 
*/
public void start() {
// Tell all pages to start talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.start();
}
}
}

/*
* Applet is no longer displayed
*/
public void stop() {
// Tell all pages to stop talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.stop();
}
}
}

/**
* Applet cleanup
*/
public void destroy() {
tabbed_pane = null;
main_panel = null;
}

/**
* This class provides the contents of a notebook page
* representing a server connection.
*/
class SOAPMonitorPage extends JPanel 
implements Runnable,
ListSelectionListener,
ActionListener {

/**
* Status Strings
*/
private final String STATUS_ACTIVE = "The SOAP Monitor is started.";
private final String STATUS_STOPPED = "The SOAP Monitor is stopped.";
private final String STATUS_CLOSED = "The server communication has been terminated.";
private final String STATUS_NOCONNECT = "The SOAP Monitor is unable to communcate with the server.";

/**
* Private data
*/
private String host = null;
private Socket socket = null;
private ObjectInputStream in = null;
private ObjectOutputStream out = null;
private SOAPMonitorTableModel model = null;
private JTable table = null;
private JScrollPane scroll = null;
private JPanel list_panel = null;
private JPanel list_buttons = null;
private JButton remove_button = null;
private JButton remove_all_button = null;
private JButton filter_button = null;
private JPanel details_panel = null;
private JPanel details_header = null;
private JSplitPane details_soap = null;
private JPanel details_buttons = null;
private JLabel details_time = null;
private JLabel details_target = null;
private JLabel details_status = null;
private JLabel details_time_value = null;
private JLabel details_target_value = null;
private JLabel details_status_value = null;
private EmptyBorder empty_border = null;
private EtchedBorder etched_border = null;
private JPanel request_panel = null;
private JPanel response_panel = null;
private JLabel request_label = null;
private JLabel response_label = null;
private SOAPMonitorTextArea request_text = null;
private SOAPMonitorTextArea response_text = null;
private JScrollPane request_scroll = null;
private JScrollPane response_scroll = null;
private JButton layout_button = null;
private JSplitPane split = null;
private JPanel status_area = null;
private JPanel status_buttons = null;
private JButton start_button = null;
private JButton stop_button = null;
private JLabel status_text = null;
private JPanel status_text_panel = null;
private SOAPMonitorFilter filter = null;
private GridBagLayout details_header_layout = null;
private GridBagConstraints details_header_constraints = null;
private JCheckBox reflow_xml = null;

/**
* Constructor (create and layout page)
*/
public SOAPMonitorPage(String host_name) {
host = host_name;
// Set up default filter (show all messages)
filter = new SOAPMonitorFilter();
// Use borders to help improve appearance
etched_border = new EtchedBorder();
// Build top portion of split (list panel) 
model = new SOAPMonitorTableModel();
table = new JTable(model);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setRowSelectionInterval(0,0);
table.setPreferredScrollableViewportSize(new Dimension(600, 96));
table.getSelectionModel().addListSelectionListener(this);
scroll = new JScrollPane(table);
remove_button = new JButton("Remove");
remove_button.addActionListener(this);
remove_button.setEnabled(false);
remove_all_button = new JButton("Remove All");
remove_all_button.addActionListener(this);
filter_button = new JButton("Filter ...");
filter_button.addActionListener(this);
list_buttons = new JPanel();
list_buttons.setLayout(new FlowLayout());
list_buttons.add(remove_button);
list_buttons.add(remove_all_button);
list_buttons.add(filter_button);
list_panel = new JPanel();
list_panel.setLayout(new BorderLayout());
list_panel.add(scroll,BorderLayout.CENTER);
list_panel.add(list_buttons, BorderLayout.SOUTH);
list_panel.setBorder(empty_border);
// Build bottom portion of split (message details) 
details_time = new JLabel("Time: ", SwingConstants.RIGHT);
details_target = new JLabel("Target Service: ", SwingConstants.RIGHT);
details_status = new JLabel("Status: ", SwingConstants.RIGHT);
details_time_value = new JLabel();
details_target_value = new JLabel();
details_status_value = new JLabel();
Dimension preferred_size = details_time.getPreferredSize();
preferred_size.width = 1;
details_time.setPreferredSize(preferred_size); 
details_target.setPreferredSize(preferred_size); 
details_status.setPreferredSize(preferred_size); 
details_time_value.setPreferredSize(preferred_size); 
details_target_value.setPreferredSize(preferred_size); 
details_status_value.setPreferredSize(preferred_size);
details_header = new JPanel();
details_header_layout = new GridBagLayout();
details_header.setLayout(details_header_layout);
details_header_constraints = new GridBagConstraints();
details_header_constraints.fill=GridBagConstraints.BOTH;
details_header_constraints.weightx=0.5;
details_header_layout.setConstraints(details_time,details_header_constraints);
details_header.add(details_time);
details_header_layout.setConstraints(details_time_value,details_header_constraints);
details_header.add(details_time_value);
details_header_layout.setConstraints(details_target,details_header_constraints);
details_header.add(details_target);
details_header_constraints.weightx=1.0;
details_header_layout.setConstraints(details_target_value,details_header_constraints);
details_header.add(details_target_value);
details_header_constraints.weightx=.5;
details_header_layout.setConstraints(details_status,details_header_constraints);
details_header.add(details_status);
details_header_layout.setConstraints(details_status_value,details_header_constraints);
details_header.add(details_status_value);
details_header.setBorder(etched_border);
request_label = new JLabel("SOAP Request", SwingConstants.CENTER);
request_text = new SOAPMonitorTextArea();
request_text.setEditable(false);
request_scroll = new JScrollPane(request_text);
request_panel = new JPanel();
request_panel.setLayout(new BorderLayout());
request_panel.add(request_label, BorderLayout.NORTH);
request_panel.add(request_scroll, BorderLayout.CENTER);
response_label = new JLabel("SOAP Response", SwingConstants.CENTER);
response_text = new SOAPMonitorTextArea();
response_text.setEditable(false);
response_scroll = new JScrollPane(response_text);
response_panel = new JPanel();
response_panel.setLayout(new BorderLayout());
response_panel.add(response_label, BorderLayout.NORTH);
response_panel.add(response_scroll, BorderLayout.CENTER);
details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
details_soap.setTopComponent(request_panel);
details_soap.setRightComponent(response_panel);
details_soap.setResizeWeight(.5);
details_panel = new JPanel();
layout_button = new JButton("Switch Layout");
layout_button.addActionListener(this);
reflow_xml = new JCheckBox("Reflow XML text");
reflow_xml.addActionListener(this);
details_buttons = new JPanel();
details_buttons.setLayout(new FlowLayout());
details_buttons.add(reflow_xml);
details_buttons.add(layout_button);
details_panel.setLayout(new BorderLayout());
details_panel.add(details_header,BorderLayout.NORTH);
details_panel.add(details_soap,BorderLayout.CENTER);
details_panel.add(details_buttons,BorderLayout.SOUTH);
details_panel.setBorder(empty_border);
// Add the two parts to the age split pane
split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
split.setTopComponent(list_panel);
split.setRightComponent(details_panel);
// Build status area
start_button = new JButton("Start");
start_button.addActionListener(this);
stop_button = new JButton("Stop");
stop_button.addActionListener(this);
status_buttons = new JPanel();
status_buttons.setLayout(new FlowLayout());
status_buttons.add(start_button);
status_buttons.add(stop_button);
status_text = new JLabel();
status_text.setBorder(new BevelBorder(BevelBorder.LOWERED));
status_text_panel = new JPanel();
status_text_panel.setLayout(new BorderLayout());
status_text_panel.add(status_text, BorderLayout.CENTER);
status_text_panel.setBorder(empty_border);
status_area = new JPanel();
status_area.setLayout(new BorderLayout());
status_area.add(status_buttons, BorderLayout.WEST);
status_area.add(status_text_panel, BorderLayout.CENTER);
status_area.setBorder(etched_border);
// Add the split and status area to page
setLayout(new BorderLayout());
add(split, BorderLayout.CENTER);
add(status_area, BorderLayout.SOUTH);
}

/**
* Get the name of the host we are displaying
*/
public String getHost() {
return host;
}

/**
* Set the status text
*/
public void setStatus(String txt) {
status_text.setForeground(Color.black);
status_text.setText(" "+txt);
}

/**
* Set the status text to an error
*/
public void setErrorStatus(String txt) {
status_text.setForeground(Color.red);
status_text.setText(" "+txt);
}

/**
* Start talking to the server
*/
public void start() {
String codehost = getCodeBase().getHost();
if (socket == null) {
try {
// Open the socket to the server
socket = new Socket(codehost, port);
// Create output stream
out = new ObjectOutputStream(socket.getOutputStream());
out.flush();
// Create input stream and start background
// thread to read data from the server
in = new ObjectInputStream(socket.getInputStream());
new Thread(this).start();
} catch (Exception e) {
// Exceptions here are unexpected, but we can't
// really do anything (so just write it to stdout
// in case someone cares and then ignore it)
System.out.println("Exception! "+e.toString());
e.printStackTrace();
setErrorStatus(STATUS_NOCONNECT);
socket = null;
}
} else {
// Already started
}
if (socket != null) {
// Make sure the right buttons are enabled
start_button.setEnabled(false);
stop_button.setEnabled(true);
setStatus(STATUS_ACTIVE);
}
}

/**
* Stop talking to the server
*/
public void stop() {
if (socket != null) {
// Close all the streams and socket
if (out != null) {
try {
out.close();
} catch (IOException ioe) {
}
out = null;
}
if (in != null) {
try {
in.close();
} catch (IOException ioe) {
}
in = null;
}
if (socket != null) {
try {
socket.close();
} catch (IOException ioe) {
}
socket = null;
}
} else {
// Already stopped
}
// Make sure the right buttons are enabled
start_button.setEnabled(true);
stop_button.setEnabled(false);
setStatus(STATUS_STOPPED);
}

/**
* Background thread used to receive data from
* the server.
*/
public void run() {
Long id;
Integer message_type;
String target;
String soap;
SOAPMonitorData data;
int selected;
int row;
boolean update_needed;
while (socket != null) {
try {
// Get the data from the server
message_type = (Integer) in.readObject();
// Process the data depending on its type
switch (message_type.intValue()) {
case SOAPMonitorConstants.SOAP_MONITOR_REQUEST:
// Get the id, target and soap info
id = (Long) in.readObject();
target = (String) in.readObject();
soap = (String) in.readObject();

=== message truncated ===

---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: SoapMonitorApplet

Posted by Tony Blair <hr...@yahoo.com>.
Thanks very much Venkatesh. This is much better. I will go ahead and compile and see what happens.
 
Thanks again,
Tony.

Venkatesh Kancharla <ve...@strandgenomics.com> wrote:
Hi Tony,
SOAPMonitorApplet comes with axis installation itself and is
located at webapps/axis/ directory. Anyways Iam attaching that file. 

regards
venkatesh

On Tue, 10 Feb 2004, Tony Blair wrote:

> Thanks Dhanush, I do not find the SoapMonitorApplet.java anywhere in
> the axis-home. I even looked in the jar files in the lib dir.
> 
> Thanks,
> Tony.
> 
> Dhanush Gopinath wrote:
> 
> Hi Tony,
> 
> The SoapMonitorApplet will be there in this folder.
> 
> axis-home\webapps\axis
> 
> To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.
> 
> Cheerio
> 
> Dhanush
> ----- Original Message ----- 
> From: Tony Blair 
> To: axis-user@ws.apache.org 
> Sent: Tuesday, February 10, 2004 3:33 AM
> Subject: SoapMonitorApplet
> 
> 
> Hi,
> 
> I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?
> 
> Thanks,
> Tony.
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
> *********************************************************
> Disclaimer
> 
> This message (including any attachments) contains 
> confidential information intended for a specific 
> individual and purpose, and is protected by law. 
> If you are not the intended recipient, you should 
> delete this message and are hereby notified that 
> any disclosure, copying, or distribution of this
> message, or the taking of any action based on it, 
> is strictly prohibited.
> 
> *********************************************************
> Visit us at http://www.mahindrabt.com
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* .
*/

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;

import org.apache.axis.monitor.SOAPMonitorConstants;

/**
* This is a SOAP Mointor Applet class. This class provides
* the user interface for displaying data from the SOAP
* monitor service.
*
* @author Brian Price (pricebe@us.ibm.com)
*
*/
public class SOAPMonitorApplet extends JApplet {

/**
* Private data
*/
private JPanel main_panel = null;
private JTabbedPane tabbed_pane = null;
private int port = 0;
private Vector pages = null;

/**
* Constructor
*/
public SOAPMonitorApplet() {
}

/**
* Applet initialization
*/
public void init() {
// Get the port to be used
String port_str = getParameter("port");
if (port_str != null) {
port = Integer.parseInt(port_str);
}
// Try to use the system look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e){
}
// Create main panel to hold notebook
main_panel = new JPanel();
main_panel.setBackground(Color.white);
main_panel.setLayout(new BorderLayout());
setContentPane(main_panel);
// Create the notebook
tabbed_pane = new JTabbedPane(JTabbedPane.TOP);
main_panel.add(tabbed_pane,BorderLayout.CENTER);
// Add notebook page for default host connection
pages = new Vector();
addPage(new SOAPMonitorPage(getCodeBase().getHost()));
}

/**
* Add a page to the notebook
*/
private void addPage(SOAPMonitorPage pg) {
tabbed_pane.addTab(" "+pg.getHost()+" ", pg);
pages.addElement(pg);
}

/** 
* Applet is being displayed 
*/
public void start() {
// Tell all pages to start talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.start();
}
}
}

/*
* Applet is no longer displayed
*/
public void stop() {
// Tell all pages to stop talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.stop();
}
}
}

/**
* Applet cleanup
*/
public void destroy() {
tabbed_pane = null;
main_panel = null;
}

/**
* This class provides the contents of a notebook page
* representing a server connection.
*/
class SOAPMonitorPage extends JPanel 
implements Runnable,
ListSelectionListener,
ActionListener {

/**
* Status Strings
*/
private final String STATUS_ACTIVE = "The SOAP Monitor is started.";
private final String STATUS_STOPPED = "The SOAP Monitor is stopped.";
private final String STATUS_CLOSED = "The server communication has been terminated.";
private final String STATUS_NOCONNECT = "The SOAP Monitor is unable to communcate with the server.";

/**
* Private data
*/
private String host = null;
private Socket socket = null;
private ObjectInputStream in = null;
private ObjectOutputStream out = null;
private SOAPMonitorTableModel model = null;
private JTable table = null;
private JScrollPane scroll = null;
private JPanel list_panel = null;
private JPanel list_buttons = null;
private JButton remove_button = null;
private JButton remove_all_button = null;
private JButton filter_button = null;
private JPanel details_panel = null;
private JPanel details_header = null;
private JSplitPane details_soap = null;
private JPanel details_buttons = null;
private JLabel details_time = null;
private JLabel details_target = null;
private JLabel details_status = null;
private JLabel details_time_value = null;
private JLabel details_target_value = null;
private JLabel details_status_value = null;
private EmptyBorder empty_border = null;
private EtchedBorder etched_border = null;
private JPanel request_panel = null;
private JPanel response_panel = null;
private JLabel request_label = null;
private JLabel response_label = null;
private SOAPMonitorTextArea request_text = null;
private SOAPMonitorTextArea response_text = null;
private JScrollPane request_scroll = null;
private JScrollPane response_scroll = null;
private JButton layout_button = null;
private JSplitPane split = null;
private JPanel status_area = null;
private JPanel status_buttons = null;
private JButton start_button = null;
private JButton stop_button = null;
private JLabel status_text = null;
private JPanel status_text_panel = null;
private SOAPMonitorFilter filter = null;
private GridBagLayout details_header_layout = null;
private GridBagConstraints details_header_constraints = null;
private JCheckBox reflow_xml = null;

/**
* Constructor (create and layout page)
*/
public SOAPMonitorPage(String host_name) {
host = host_name;
// Set up default filter (show all messages)
filter = new SOAPMonitorFilter();
// Use borders to help improve appearance
etched_border = new EtchedBorder();
// Build top portion of split (list panel) 
model = new SOAPMonitorTableModel();
table = new JTable(model);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setRowSelectionInterval(0,0);
table.setPreferredScrollableViewportSize(new Dimension(600, 96));
table.getSelectionModel().addListSelectionListener(this);
scroll = new JScrollPane(table);
remove_button = new JButton("Remove");
remove_button.addActionListener(this);
remove_button.setEnabled(false);
remove_all_button = new JButton("Remove All");
remove_all_button.addActionListener(this);
filter_button = new JButton("Filter ...");
filter_button.addActionListener(this);
list_buttons = new JPanel();
list_buttons.setLayout(new FlowLayout());
list_buttons.add(remove_button);
list_buttons.add(remove_all_button);
list_buttons.add(filter_button);
list_panel = new JPanel();
list_panel.setLayout(new BorderLayout());
list_panel.add(scroll,BorderLayout.CENTER);
list_panel.add(list_buttons, BorderLayout.SOUTH);
list_panel.setBorder(empty_border);
// Build bottom portion of split (message details) 
details_time = new JLabel("Time: ", SwingConstants.RIGHT);
details_target = new JLabel("Target Service: ", SwingConstants.RIGHT);
details_status = new JLabel("Status: ", SwingConstants.RIGHT);
details_time_value = new JLabel();
details_target_value = new JLabel();
details_status_value = new JLabel();
Dimension preferred_size = details_time.getPreferredSize();
preferred_size.width = 1;
details_time.setPreferredSize(preferred_size); 
details_target.setPreferredSize(preferred_size); 
details_status.setPreferredSize(preferred_size); 
details_time_value.setPreferredSize(preferred_size); 
details_target_value.setPreferredSize(preferred_size); 
details_status_value.setPreferredSize(preferred_size);
details_header = new JPanel();
details_header_layout = new GridBagLayout();
details_header.setLayout(details_header_layout);
details_header_constraints = new GridBagConstraints();
details_header_constraints.fill=GridBagConstraints.BOTH;
details_header_constraints.weightx=0.5;
details_header_layout.setConstraints(details_time,details_header_constraints);
details_header.add(details_time);
details_header_layout.setConstraints(details_time_value,details_header_constraints);
details_header.add(details_time_value);
details_header_layout.setConstraints(details_target,details_header_constraints);
details_header.add(details_target);
details_header_constraints.weightx=1.0;
details_header_layout.setConstraints(details_target_value,details_header_constraints);
details_header.add(details_target_value);
details_header_constraints.weightx=.5;
details_header_layout.setConstraints(details_status,details_header_constraints);
details_header.add(details_status);
details_header_layout.setConstraints(details_status_value,details_header_constraints);
details_header.add(details_status_value);
details_header.setBorder(etched_border);
request_label = new JLabel("SOAP Request", SwingConstants.CENTER);
request_text = new SOAPMonitorTextArea();
request_text.setEditable(false);
request_scroll = new JScrollPane(request_text);
request_panel = new JPanel();
request_panel.setLayout(new BorderLayout());
request_panel.add(request_label, BorderLayout.NORTH);
request_panel.add(request_scroll, BorderLayout.CENTER);
response_label = new JLabel("SOAP Response", SwingConstants.CENTER);
response_text = new SOAPMonitorTextArea();
response_text.setEditable(false);
response_scroll = new JScrollPane(response_text);
response_panel = new JPanel();
response_panel.setLayout(new BorderLayout());
response_panel.add(response_label, BorderLayout.NORTH);
response_panel.add(response_scroll, BorderLayout.CENTER);
details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
details_soap.setTopComponent(request_panel);
details_soap.setRightComponent(response_panel);
details_soap.setResizeWeight(.5);
details_panel = new JPanel();
layout_button = new JButton("Switch Layout");
layout_button.addActionListener(this);
reflow_xml = new JCheckBox("Reflow XML text");
reflow_xml.addActionListener(this);
details_buttons = new JPanel();
details_buttons.setLayout(new FlowLayout());
details_buttons.add(reflow_xml);
details_buttons.add(layout_button);
details_panel.setLayout(new BorderLayout());
details_panel.add(details_header,BorderLayout.NORTH);
details_panel.add(details_soap,BorderLayout.CENTER);
details_panel.add(details_buttons,BorderLayout.SOUTH);
details_panel.setBorder(empty_border);
// Add the two parts to the age split pane
split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
split.setTopComponent(list_panel);
split.setRightComponent(details_panel);
// Build status area
start_button = new JButton("Start");
start_button.addActionListener(this);
stop_button = new JButton("Stop");
stop_button.addActionListener(this);
status_buttons = new JPanel();
status_buttons.setLayout(new FlowLayout());
status_buttons.add(start_button);
status_buttons.add(stop_button);
status_text = new JLabel();
status_text.setBorder(new BevelBorder(BevelBorder.LOWERED));
status_text_panel = new JPanel();
status_text_panel.setLayout(new BorderLayout());
status_text_panel.add(status_text, BorderLayout.CENTER);
status_text_panel.setBorder(empty_border);
status_area = new JPanel();
status_area.setLayout(new BorderLayout());
status_area.add(status_buttons, BorderLayout.WEST);
status_area.add(status_text_panel, BorderLayout.CENTER);
status_area.setBorder(etched_border);
// Add the split and status area to page
setLayout(new BorderLayout());
add(split, BorderLayout.CENTER);
add(status_area, BorderLayout.SOUTH);
}

/**
* Get the name of the host we are displaying
*/
public String getHost() {
return host;
}

/**
* Set the status text
*/
public void setStatus(String txt) {
status_text.setForeground(Color.black);
status_text.setText(" "+txt);
}

/**
* Set the status text to an error
*/
public void setErrorStatus(String txt) {
status_text.setForeground(Color.red);
status_text.setText(" "+txt);
}

/**
* Start talking to the server
*/
public void start() {
String codehost = getCodeBase().getHost();
if (socket == null) {
try {
// Open the socket to the server
socket = new Socket(codehost, port);
// Create output stream
out = new ObjectOutputStream(socket.getOutputStream());
out.flush();
// Create input stream and start background
// thread to read data from the server
in = new ObjectInputStream(socket.getInputStream());
new Thread(this).start();
} catch (Exception e) {
// Exceptions here are unexpected, but we can't
// really do anything (so just write it to stdout
// in case someone cares and then ignore it)
System.out.println("Exception! "+e.toString());
e.printStackTrace();
setErrorStatus(STATUS_NOCONNECT);
socket = null;
}
} else {
// Already started
}
if (socket != null) {
// Make sure the right buttons are enabled
start_button.setEnabled(false);
stop_button.setEnabled(true);
setStatus(STATUS_ACTIVE);
}
}

/**
* Stop talking to the server
*/
public void stop() {
if (socket != null) {
// Close all the streams and socket
if (out != null) {
try {
out.close();
} catch (IOException ioe) {
}
out = null;
}
if (in != null) {
try {
in.close();
} catch (IOException ioe) {
}
in = null;
}
if (socket != null) {
try {
socket.close();
} catch (IOException ioe) {
}
socket = null;
}
} else {
// Already stopped
}
// Make sure the right buttons are enabled
start_button.setEnabled(true);
stop_button.setEnabled(false);
setStatus(STATUS_STOPPED);
}

/**
* Background thread used to receive data from
* the server.
*/
public void run() {
Long id;
Integer message_type;
String target;
String soap;
SOAPMonitorData data;
int selected;
int row;
boolean update_needed;
while (socket != null) {
try {
// Get the data from the server
message_type = (Integer) in.readObject();
// Process the data depending on its type
switch (message_type.intValue()) {
case SOAPMonitorConstants.SOAP_MONITOR_REQUEST:
// Get the id, target and soap info
id = (Long) in.readObject();
target = (String) in.readObject();
soap = (String) in.readObject();

=== message truncated ===

---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: SoapMonitorApplet

Posted by Venkatesh Kancharla <ve...@strandgenomics.com>.
Hi Tony,
	SOAPMonitorApplet comes with axis installation itself and is
located at webapps/axis/ directory. Anyways Iam attaching that file. 

regards
venkatesh

On Tue, 10 Feb 2004, Tony Blair wrote:

> Thanks Dhanush, I do not find the SoapMonitorApplet.java anywhere in
> the axis-home. I even looked in the jar files in the lib dir.
>  
> Thanks,
> Tony.
> 
> Dhanush Gopinath <dh...@mahindrabt.com> wrote:
>  
> Hi Tony,
>  
> The SoapMonitorApplet will be there in this folder.
>  
> axis-home\webapps\axis
>  
> To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.
>  
> Cheerio
>  
> Dhanush
> ----- Original Message ----- 
> From: Tony Blair 
> To: axis-user@ws.apache.org 
> Sent: Tuesday, February 10, 2004 3:33 AM
> Subject: SoapMonitorApplet
> 
> 
> Hi,
>  
> I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?
>  
> Thanks,
> Tony.
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
> *********************************************************
> Disclaimer
> 
> This message (including any attachments) contains 
> confidential information intended for a specific 
> individual and purpose, and is protected by law. 
> If you are not the intended recipient, you should 
> delete this message and are hereby notified that 
> any disclosure, copying, or distribution of this
> message, or the taking of any action based on it, 
> is strictly prohibited.
> 
> *********************************************************
> Visit us at http://www.mahindrabt.com
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online

Re: SoapMonitorApplet

Posted by Tony Blair <hr...@yahoo.com>.
Thanks Dhanush, I do not find the SoapMonitorApplet.java anywhere in the axis-home. I even looked in the jar files in the lib dir.
 
Thanks,
Tony.

Dhanush Gopinath <dh...@mahindrabt.com> wrote:
 
Hi Tony,
 
The SoapMonitorApplet will be there in this folder.
 
axis-home\webapps\axis
 
To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.
 
Cheerio
 
Dhanush
----- Original Message ----- 
From: Tony Blair 
To: axis-user@ws.apache.org 
Sent: Tuesday, February 10, 2004 3:33 AM
Subject: SoapMonitorApplet


Hi,
 
I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?
 
Thanks,
Tony.


---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com



---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: SoapMonitorApplet

Posted by Dhanush Gopinath <dh...@mahindrabt.com>.
Hi Tony,

The SoapMonitorApplet will be there in this folder.

axis-home\webapps\axis

To use that u must comment out the tag in web.xml file and compile the Applet java file using normal javac.

Cheerio

Dhanush
  ----- Original Message ----- 
  From: Tony Blair 
  To: axis-user@ws.apache.org 
  Sent: Tuesday, February 10, 2004 3:33 AM
  Subject: SoapMonitorApplet

  Hi,

  I looked thru the archives and saw one post about the SoapMonitorApplet. It mentioned that the applet is part of the axis folders. I search thru the axis folders, lib and src but couldn't find it. I am trying to access http://localhost:8080/axis/SOAPMonitor and I get an Class not found exception for the SoapMonitorApplet.class. Any idea?

  Thanks,
  Tony.

------------------------------------------------------------------------------
  Do you Yahoo!?
  Yahoo! Finance: Get your refund fast by filing online

*********************************************************
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com