WebReference.com - Part 5 of chapter 3 from Professional Java Web Services, Wrox Press Ltd. (6/6)
[previous] |
Professional Java Web Services
Debugging SOAP Clients and Services
When debugging Apache SOAP clients and services it's useful to look at the SOAP messages that are being exchanged between the client and the Apache SOAP server. Also, by looking at the SOAP messages one can gain a better understanding of how SOAP works. TCP tunnel/monitor tool packaged with Apache SOAP provides this capability. The tool acts as a proxy--requests from a SOAP client are retrieved, displayed, and forwarded to a SOAP server. Likewise, a response from a SOAP server is received, displayed, and forwarded back to the SOAP client. To start the tool, use the following syntax:
>java org.apache.soap.util.net.TcpTunnelGui listenport tunnelhost tunnelport
Where listenport
is the port that SOAP clients will use to send SOAP requests, the
tunnelhost
and tunnelport
are the hostname/IP address and port number of
where the SOAP server is running. The following command could be used to start the tool listening on
port 9090 with request being forwarded to localhost on port 8080 (where the SOAP server is running):
>java org.apache.soap.util.net.TcpTunnelGui 9090 localhost 8080
The following window will appear:
We can peek at the SOAP message that was generated by submitResume
servlet by simply
changing the RPCROUTER
global variable so that it points to the port that the TCP
tunnel/monitor tool is listening on. So, now the RPCROUTER
variable would look like
the following:
static String RPCROUTER = "https://localhost:9090/rpcrouter";
After recompiling the servlet try to submit a resumé. The end result should look something like this:
The textbox on the left contains the SOAP message sent by the SOAP client. The textbox on the right contains the SOAP message received from the SOAP server.
Summary
In this chapter we discussed Apache SOAP 1.1, an opensource implementation of SOAP 1.1 and SOAP with Attachments. We covered the following topics:
- History of Apache SOAP; specifically, we discussed the fact that IBM originally developed Apache SOAP, which was called IBM-SOAP
- Axis, the next generation of Apache SOAP was discussed.
- Installing Apache SOAP
- Deploying and running a service
- Developing an Apache SOAP service
- Developing an Apache SOAP client
- Type mapping
- Serialization
- Pluggable Provider architecture
- Debugging SOAP clients and services
[previous] |
Created: June 17, 2002
Revised: June 17, 2002
URL: https://webreference.com/programming/java/webservices/chap3/5/6.html