The AS7 book!

JBoss Tuning

JBoss 5 book

No Registration required. Use your FB account to add comments to articles.

Twitter Button

Poll

Which is your favourite JSF library?
 
Top Programming Sites
Home JBoss AS How to debug Web Services

How to debug Web Services

  
In this tutorial we will see how you can debug your JBoss Web Services applications by using some built-in logging features or using an external TCP dumper.
Debbugging SOAP Messages is a critical activity for every application running Web Services. 
The simplest way to see the full SOAP messages returned by JBoss create a new Category for the SOAP Message Class in your conf/jboss-log4j.xml. All you have to do is add the following XML fragment in your Category section:
<category name="jbossws.SOAPMessage">  
   <priority value="DEBUG" />  
</category>  
Another alternative can be monitoring your Web Service Port using an external tool. We have tested Apache TCPMon which is a valuable tool for monitoring your network applications.

Download here the lastest stable release of it:
http://ws.apache.org/commons/tcpmon/download.cgi

Launch the main Program in build/tcpmon.cmd

Configuring the Monitor is pretty easy. For our purpose we need to intercept Web Service request before they reach the Server and as well we need to capture response before they reach the client.

In the Admin tab select a Listening port for Apache TCPMon and a target port which corresponds to JBoss AS listening port. For example:

jboss web services debug tcpmon 
Now modify your Web Services client so that they point to the Apache TCPMon Port instead of JBoss. For example:
 public static void main(String args[]) throws Exception {   
 String endpointURI ="http://127.0.0.1:8888/ejb/HelloWorld?wsdl";   
 String helloWorld = "Hello world!";   
 
 Object retObj = getPort(endpointURI).echo(helloWorld);   
 System.out.println(retObj);   
 }   
In the meantime, you will find the outcomign and incoming SOAP Messages in the TCPMon Console:
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.
For additional information about it, check:
http://ws.apache.org/commons/tcpmon/tcpmontutorial.html