For an error handling of let’s say a a backend service being inaccessible, I want to return a 503 Service Unavailable error in my HTTP header accompanied by a response in application/json format.
I was able to do this successfully using setResponse2 (for the content type) and setResponseCode (for the HTTP header).
However, when I test this in Designer, I keep getting the prompt saying “Server connection to ‘localhost’ lost. Try restoring session later.” It seems that Designer is acknowledging my forced 503 Service Unavailable error as an error it encountered, even though it should be the one returning this error.
I’ve observed this when trying to return a series of 5xx HTTP status codes.
Wanted to check if there is a workaround on how to suppress this as when I test using SoapUI or Postman, I’m able to receive the expected response. For those unfamiliar with the service though and they encounter this in Designer, this can be disconcerting as they may think something’s wrong with their server.
Could not run ‘_post’
com.wm.net.NetException: [ISC.0064.9324] Server Error: 503 Service Unavailable
com.wm.net.NetException: [ISC.0064.9324] Server Error: 503 Service Unavailable
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:643)
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:279)
at com.wm.driver.comm.b2b.http.SessionHTTPLink.transportMsg(SessionHTTPLink.java:85)
at com.wm.driver.comm.b2b.http.HTTPLink$HTTPSendReceive.run(HTTPLink.java:380)
at java.lang.Thread.run(Thread.java:748)
Login in to Designer → Preferences → General → Network Connections → Active Providers.
If Active providers set as Manual/Native, Please set this as ‘Direct’ and test the functionality.
None, once I’ve acknowledged the prompt that localhost got disconnected, it refreshes on its own. When I check our server logs, no unexpected messages as well.
It really just happens in the scenario I mentioned above.
Hi, any updates on this? Just realized that this behavior will still be encountered when running a wMTestSuite:
com.wm.net.NetException: [ISC.0064.9324] Server Error: 501 Not Implemented
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:643)
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:279)
at com.wm.driver.comm.b2b.http.SessionHTTPLink.transportMsg(SessionHTTPLink.java:85)
at com.wm.driver.comm.b2b.http.HTTPLink$HTTPSendReceive.run(HTTPLink.java:380)
at java.lang.Thread.run(Thread.java:748)