More details: the data is gzipped by GWT-RPC on server-side
class RPCServletUtils
writeResponse()
{
   byte[] responseBytes = responseContent.getBytes(CHARSET_UTF8);
   ...
   ByteArrayOutputStream output = new ByteArrayOutputStream
(responseBytes.length);
   gzipOutputStream = new GZIPOutputStream(output);
   responseBytes = output.toByteArray();
   ...
   response.getOutputStream().write(responseBytes);
}

and then the zipped array was zipped second time
by the SAP server:

class GzipResponseStream
public void write(byte b[], int off, int len)
{
   if( len <= buf.length )
     System.arraycopy(b, off, buf, count, len);
   else
     gzipmultistream.write(servletoutput, b, off, len);
}

On the client-side the browser unzips the response only once
(regardless of two "content-encoding: gzip" headers :)

And then GWT-RPC client-side code tries to decode the response:

class RequestCallbackAdapter
onResponseReceived()
{
   String encodedResponse = response.getText();
   // but the this is zipped json, not encoded text.
   // and thus
   caught = new InvocationException(encodedResponse);
}

So, as solution I can add "application/json" to list
of content-types which are not zipped by the server.
Or override the shouldCompressResponse() of
RemoteServiceServlet and return false there.

Additional solution is to create bug ticket to GWT-RPC
client-side, which doesn't try to unzip response :)


--
Zmitro Lapcionak

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to