HTTP Response code manipulation

There is a scenario – clients post HTTP request to webMehtods developer flow service. Now, if the server is up and service is available, client gets a 200 response code back.
Now, my intention is to develop the flow service in such a way that – i will stop the server to send response (200) until my flow is executed successfully. If it gets processed successfully; i will send 200 but if something errors out in flow - i will send 500 (Internal Server Error) response back to client; thus indicating them to resend the request.
We can’t use setResponse flow bcz it sends business response. I want to manipulate the Protocol level response in this case.
could you please let me know if there is any solution to this?

The easiest way to indicate an error is to simply throw an exception from your service. The server will return an error code (I don’t recall which error code is the default) and the response content you (optionally) set using setResponse. If no response is set, IS returns the contents of the pipeline in an HTML table.

If you’re using 6.5 or later, you can use setResponseCode to set the specific error code you desire.

Here are a couple of threads that have additional info, if you want to control more aspects of the http response (setting http headers, setting different content types, etc.).

Do a search for “setResponse” for more threads on the topic.