Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    transformResponse with status != 0

    I override RestDataSource.transformResponse(DSResponse response, DSRequest request, Object data), and it gets called fine when a response is received with status = 0. When my server side returns a status -1, my transformResponse does still gets called, but with a status 0? I allready tried setting dsRequest.setWillHandleError(true);

    thanks!

    Bas

    #2
    The status on DSResponse is set in the base transformResponse method of RestDataSource. So if you call super.transformResponse() first, then DSResponse.getStatus() will return the correct status. Alternatively you can read the status value from the raw data response yourself.

    For RestDataSource the response in an XML document and you can call XMLTools.selectString(data, "//status") to extract the status value returned by the server.

    Sanjiv

    Comment

    Working...
    X