[
http://jira.jboss.com/jira/browse/JBREM-544?page=comments#action_12339673 ]
Tom Elrod commented on JBREM-544:
----------------------------------
Have made code changes to HTTPClientInvoker to by default throw an excpetion when response
code is >= 400. This is for all transports it supports (http, https, servlet, and
sslservlet). The exact exception type thrown will depend on the type of web server the
client is interacting with. If it is a JBoss Remoting server (http(s) server invoker),
the exception thrown will be the one originally generated on the server side. If the
server is not a JBoss Remoting server (e.g. JBossAS, Tomcat, Apache Web Server, etc.), the
exception throw will be org.jboss.test.remoting.transport.http.WebServerError. The
WebServerError's message will be the error html returned by the web server.
To turn off the throwing of an exception when the web server responds with an error, can
add config to the configuration map passed to the Client.invoke() method where they key is
HTTPMetadataConstants.NO_THROW_ON_ERROR (actual text value 'NoThrowOnError') and a
value of of type java.lang.String set to 'true'. This will cause the http client
invoker to *not* throw an exception, but instead return the data from the web server error
stream. IMPORTANT: In the case that the data returned from this error stream is of type
java.lang.String (i.e. is error html), it *will* be wrapped in a WebServerError and
returned as this type. The raw data from the web server can the be retreived by getting
the WebServerError's message.
http client invoker (for http, https, servlet, and sslservlet) needs
to handle exceptions in same manner as other transport implementations
-------------------------------------------------------------------------------------------------------------------------------------------
Key: JBREM-544
URL:
http://jira.jboss.com/jira/browse/JBREM-544
Project: JBoss Remoting
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: general
Affects Versions: 2.0.0.Beta2 (Boon)
Reporter: Tom Elrod
Assigned To: Tom Elrod
Fix For: 2.0.0.CR1 (Boon)
All the other transport clients will throw an exception from the Client.invoke() method
when an error occurs. However, the http client invoker currently does not. This is a
problem in that can not deliver on no api changes when changing transports. However,
there is a need (by the web services group) to have the exception NOT thrown. So need to
provide option for both behaviors.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira