This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes need help tracing soap messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "need help tracing soap messages" Watch "need help tracing soap messages" New topic

need help tracing soap messages

Carly Davis

Joined: May 31, 2008
Posts: 9
Hello, I'm having a hard time figuring out how to trace soap messages. I can use tcpmon but would really like to use Metro's jaxws-rt.jar version since with the Metro version I don't have to alter my code.

Here's how to do it accoring to the book Java Web Services Up and Running:
In the book Java Web Services Up and Running using the Metro tracer sounds so easy:
"The metro release has utility classes for tracking HTTP and SOAP traffic. This approach does not require any change to the client or to the sercie code; however, an additional package must be put on the classpath and a system property must be set either at command line or in code. The requierd package is in teh file jaxws_ri/jaxws-rt.jar. Assumming that the environment variable metro_home points to the jaxws-ri directory, here is the command that tracks HTTP and SOAP traffic between the timeclient, which connects to the service on port 9876, and the timeserver service.
%java -cp ".":$metro_home/lib/jaxws-rt.jar \ \

The resulting dump shows all of hte soap traffic but not all of the http headers. Message trackign also can be done on teh service side.

Here's what I'm doing:
I'm not using any sort of development tool such as Net Beans.
1. I start my publisher service to make my wsdl available:
class RabbitCounterPublisher{
public static void main(String[] args) {
int port = 8888;
String url = "http://localhost:" + port + "/rabbitCounter";
System.out.println("publishing rabbit counter on port: " + port);
Endpoint.publish(url, new RabbitCounter());
2. From Windows xp command line I execute my client as follows:
C:\JavaProjects\RabbitCounter\source>java FibClient

My client runs successfully and is able to make calls on my Web Service.

I thought that setting the property " " would make my soap messages dump out to a file however I'm not sure where this file is. Also, I do have an environment variable METRO_HOME set and I have jaxws-rt.jar in my classpath. Basically, I'm just confused as to how to get this thing to work. If anyone has experience with this I would really appreciate the help. Thanks!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
I'm not familiar with the approach you're describing, but with tcpmon you don't need to alter your code - just the URL, which generally can be configured outside of the code. (If it can't, I'd advise to make the client at least that configurable.)

SOAPUI is a much more powerful tool for monitoring SOAP connections, although most of the time I find tcpmon quite sufficient.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Take a look at WSMonitor:
It sounds like it may be useful to you.
Best wishes!
Carly Davis

Joined: May 31, 2008
Posts: 9
Thanks so much for the replies. I got sick of trying to figure it out and instead went back to tcpmon - Thanks for the wsmonitor suggestion, I've never heard of it I'll have to check it out.
I agree. Here's the link:
subject: need help tracing soap messages
It's not a secret anymore!