This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "need help tracing soap messages" Watch "need help tracing soap messages" New topic
Author

need help tracing soap messages

Carly Davis
Greenhorn

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 \
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true \
ch01.ts.TimeClient.

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:
import javax.xml.ws.Endpoint;
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 -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true FibClient

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

QUESTION:
I thought that setting the property "-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true " 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
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
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.


Ping & DNS - my free Android networking tools app
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Take a look at WSMonitor: https://wsmonitor.dev.java.net/
It sounds like it may be useful to you.
Best wishes!
Carly Davis
Greenhorn

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: http://aspose.com/file-tools
 
subject: need help tracing soap messages