ZDNet UK


Skip to Main Content

ZDNet.co.uk - Winner of Best Business Website 2007
  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Prices
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


IT Jobs

Office applications Toolkit

Debug SOAP apps

Brian Schaffner

Published: 30 Jan 2003 15:33 GMT

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

One of the most common tasks during application development is debugging. With new tools and new technologies, debugging is essential to understanding what's happening and why your application is behaving as it is.

To this end, the Apache Group distributes a nice little application as part of Apache SOAP, the TCP Tunnel/Monitor that you can use to monitor and debug your SOAP interfaces. Note that this application only applies to SOAP implementations that use HTTP as the transport.

TCP Tunnel/Monitor
The TCP Tunnel/Monitor application is really just a simple proxy application that includes a visual interface. When you run the application, you specify a host port and a target address and port. TCP Tunnel/Monitor will display a window with two text areas:

  • The text area on the left shows the incoming request, received by the application on the host port you specify.
  • The text area on the right shows the response received from the target server.

You can use the application to monitor servers locally and remotely. If your Web server is local, then you will specify a host port other than the one your Web server is currently using. For example, if you are running Tomcat on port 8080, then you can start the application with the following command:

java org.apache.soap.util.net.TcpTunnelGui 8081 localhost 8080

This command runs the TcpTunnelGui class and passes in three parameters:

  • The first parameter specifies the port that the tool will listen on. Your SOAP client will have to be redirected to this port rather than the normal port in order to see things happen.
  • The second parameter is the target address (the local machine in this case).
  • The final parameter is the target port (in this case, where Tomcat is listening).

You can point the monitor at remote servers too. Simply change the target address and port to match the host you want to monitor. For example, to monitor the messages to and from the Google Web service, you can use the following command:

java org.apache.soap.util.net.TcpTunnelGui 88 api.google.com 80

In this case, your client's SOAP location is now http://localhost:88/search/beta2 instead of http://api.google.com/search/beta2.

SOAP
When you run your SOAP client, it will send a request to the SOAP location you've specified. To use this tool, the SOAP location will be different than the normal location. Each request is proxied by the monitor program, so you will have to change the SOAP location of the service you are calling to be at host localhost and at the port you specified as the host port when starting up the tunnel.

For example, if you have an existing Web service client, it may contain some code similar to this:

String soaplocation = "http://mywebservice.mydomain.com/soap/servlet/rpcrouter";
URL soapurl = new URL(soaplocation);

You can easily modify this to point to the proxy:

String soaplocation = "http://localhost:88/soap/servlet/rpcrouter";
URL soapurl = new URL(soaplocation);

In a real application, the URL is probably not hard-coded in the source but in some externally editable file. In this case, it may make sense to have two parameters in this file -- one that points directly to the service and another that points at the proxy address. Then you could add another file item that indicates if the service is in debug mode and use it to dynamically change where the service client points to, like this Java code snippet:

String debugmode = myConfiguration.getProperty("debugMode");
String soaplocation;
if (debugmode.equalsIgnoreCase("YES")) {
   soaplocation = myConfiguration.getProperty("soapLocation");
} else {
   soaplocation = myConfiguration.getProperty("soapLocationDebug");
}

Not just for debugging SOAP
This tool is useful beyond just monitoring SOAP messages. It can be used to monitor any HTTP service as well -- and it's not dependent on Apache Web servers, either. Because the tool is a generic proxy, you can use it to monitor HTTP and SOAP messages to Microsoft IIS servers, Apache Web servers, Tomcat, WebLogic, or any other HTTP server.


For a weekly round-up of the enterprise IT news, sign up for the
Enterpise newsletter.

Find out what's where in the new Tech Update with our
Guided Tour.

Tell us what you think in the
Enterprise Mailroom.

  • Email
  • Trackback
  • Clip Link
  • Print friendly Print with Dell

Did you find this article useful?
31 out of 74 people found this useful


Full Talkback thread

0 comments


Company/Topic Alerts

Create a new alert from the list below:









Related Jobs

Java Project Engineer

Struts 1 and 2 - Spring - Spring MVC - Hibernate Application Architecture - Proven experience in design and development of highly scalable production ...

Websphere MQ WBIMB Developer Required- Java ESQL

COBOL) Expertise in the following areas is required: Message and Event Broker- MRM, ESQL, Web Service calls- HTTP/SOAP and Debugging. Websphere MQ ...

Linux / Cisco Network Specialist UNIX, Linux, Cisco -Oxfordshire, South

Keywords: ISP, Windows 2000, Windows 2003, Linux, RHEL4, Unix, Red Hat, Mandrake, SUSE, Solaris, HP-UX, Cisco Switches, Cisco Routers, Cisco IOS, ...

Featured Talkback

Why do so many (virtually all) software packages think that they are so important that they have to be started automatically every time the computer boots? What is the largest number of "speed access", "update check", "camera download" and whatever other background programs you have ever seen running? Of those, how many did you really need?

By: J.A. Watson

Read full story:
Annoying software: a rogues' gallery

Discussions

harpless harpless

SAP goes big business

Friday 25 July 2008, 6:17 PM

1 comment
pjc158 pjc158

Will Drizzle rain on Sun's MySql

Friday 25 July 2008, 5:30 PM

1 comment

Vista Upgrade Blog

Microsoft's pre-modern message puts a...

Over at ZDNet.com, Ed Bott reports a first sighting of Microsoft's eagerly awaited $300 million ad campaign. Already the cause of much speculation, the consensus is that this will be... More

8 comments

A $40 CONSUMER-class router has create...

Believe it or not I don't work in IT, haven't for 7 years. Yes I work with Microsoft's Windows XP Embedded and as a result I have to know a lot about the OS, the kernal, Win API calls... More

Post a comment

Sick Puppy Redo

I generally follow a dispassionate investigative process when trying to discern what happened when a project goes bad. Although its a low priority item, it gets done simply because... More

Post a comment