I’m confused. In your original post you asked:
In a followup post you stated:
This again indicated that you were looking to catch an exception thrown by an IS service invoked via HTTP from a Java program.
I pointed out in my post that “There is no notion of throwing an exception across an HTTP connection. Your Java program will not have any understanding of “ServiceException” nor will it ever see such a thing.”
Then I go on to say that you can use the IS Java API instead of HTTP to catch ServiceExceptions, if desired.
Your latest post seems to indicate that you understood the “can’t catch an exception via HTTP” all along and that I misinterpreted your question.
In any case, you’re absolutely right that if you’re invoking the Integration Server service via HTTP that you will never be able to catch a ServiceException within your Java program–indeed you’ll never be able to catch any exception thrown by the IS service within your Java program because Java exceptions are not propogated across an HTTP connection.
If you do want to catch exceptions thrown by an IS service then you can do so if you use the IS Java API, instead of HTTP, to invoke the IS service. In this case, a ServiceException can be thrown and can be caught within your Java program.
If you want to continue using HTTP, instead of using the IS Java API, (I recommend sticking with HTTP) and you’re having issues with setResponse, perhaps you can post the snippet of your IS service that is supposed to be passing back the error via setResponse and we can take a look at what might the problem.
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB