Need help in handling response with Apache CXF WebClient JAX RS call
posted 3 years ago
I need some pointers while using the Apache CXF WebClient JAX-RS call. I get the following error when I use the API provided WebClient:
This is strange because the output page rendered on the browser (FF21.0) shows that it is of XHTML+XML. (The server code is external and we don't seem to have access to its source code)
I understand that "ISO" is not a valid encoding type or charset whereas "ISO-8859-1" etc are. I tried using @Produces and even forcing a WebClient.accept("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") and such variants.
So I thought of extending AbstractClient or rather WebClient itself and implement some necessary methods and in the process see the raw message from the server as is before response handling. The approach does not properly populate objects like "cfg" etc. I don't know if WebClient is meant to be extended, as I believe, if so CXF should have provided interfaces to handle.
I am open to other ways of doing this. Currently the only requirement is to get the HTML and grab a certain segment of it. We don't have an API exposed by application to serve us that data.
NOTE: This is not a access issue, both the apps are intranet and are SSO secure. Also the URL which we are trying to access is SSL enabled, hope this should not be an issue or may be?