I am using the JAX-WS-created client (using wsimport, the one associated with Glassfish 2.1.1) to connect to the created ASP.NET WebService running in IIS 6.
When I request compression in the response (by including the Accept-Encoding: gzip HTTP header through the JAX-WS SOAP Handlers), IIS 6 responds with a compressed response, but does not include the Content -Encoding: gzip HTTP response, so I get the following exception:
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.sun.xml.stream.XMLStreamException2: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361) at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:173) at com.sun.xml.xwss.XWSSClientPipe.process(XWSSClientPipe.java:160) at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115) at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595) at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554) at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539) at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436) at com.sun.xml.ws.client.Stub.process(Stub.java:248) at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89) at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
Edited April 17, 2011
I also tried using the same SOAPHandler I use a compressed response to request to change the response Header, but an exception occurs before the handler is called.
End Edit April 17, 2011
In addition, when I make the same request in WebService through soapUI 3.6.1 using the “Accept Compressed Responses from Hosts” option, I can see what I said: IIS 6 server does not include the HTTP response header for compression, and soapUI shows the response as "binary data" and shows these response headers:
HTTP/1.1 200 OK Date: Wed, 13 Apr 2011 08:50:55 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Content-Length: 1104
If -with soapUI- I do not request a compressed response, I get the following response size:
Content-Length: 2665
So the question here, as I said, is that IIS6 does not add the Contend-Encoding header to the response. My question is: is it possible to - program - add a Content-Encoding header? Or it could also be: is it possible to request IIS6 to include the Content-Encoding header?
UPDATE
Using Charles Web Debugging Proxy 3.5.2 I confirmed that the response from IIS6 does not include the Content-Encoding header:
HTTP/1.1 200 OK Date Wed, 13 Apr 2011 10:51:53 GMT Server Microsoft-IIS/6.0 X-Powered-By ASP.NET X-AspNet-Version 2.0.50727 Cache-Control private, max-age=0 Content-Type text/xml; charset=utf-8 Content-Length 1110
I assume this may be a problem more related to WebService than to IIS 6