I am calling a web service using message.send. As part of my testing, I have changed the host name in my URL to an invalid host. When I run the code, two error appear to be generated, an UnknownHostException and a SOAPException. I have catch logic for both errors as well as a general catch statement. The SOAPException is caught but the UnknownHostException is not.
Here is the error that is generated:
The line that generates this error is:
According to the message.send document at apache.org, the send method throws a SOAPException. This exception is being properly caught by my program and converted to a DCFException. DCFException is a custom exception that has ben created to handle all exceptions in the application. This can be see at the bottom of the eror message. A DCFException is thrown which states that there was a SOAPException. The SOAPEXCEPTION is being correctly handled.
A review of the module call chain shows that an UnknownHostException isn't thrown until InetAddress.getByName. This is the thrid module from the top.
This doesn't make sense to me. Shouldn't the only error that is returned be the SOAPException error since UnknownHostException is not defined in the signature of the message.send method?
If anyone knows why this is happening and how I can handle the UnknownHostException error, please let me know. Right now, my testing is failing because I am not handling the UnknownHostException error.
Here is my catch logic, so you can see that I am handling it and other errors that are in my code.
Thanks,
Dave