function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ostateostate 

Compression on Axis 1.4

Hello,

I want to implement compressed HTTP request/response, but it seems to fail.

I read past topics, and made several corrects to my sample which went well.

1st, I wrote sub class to make the flags true;

package com.sforce.soap.enterprise;

import javax.xml.rpc.Call;
import javax.xml.rpc.ServiceException;
import org.apache.axis.transport.http.HTTPConstants;
import com.sforce.soap.enterprise.SforceServiceLocator;

public class SforceServiceLocatorSub extends SforceServiceLocator {
    public Call createCall() throws ServiceException {
        Call call = super.createCall();
        call.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
        call.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
        return call;
    }
}

 2nd, I used the sub class to get a stub;

binding = (SoapBindingStub) new SforceServiceLocatorSub().getSoap();

3rd, I set up client-config.wsdd as follows;

<—xml version="1.0" encoding="UTF-8"–>
<deployment name="commonsHTTPConfig"
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <transport name="http"  pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" />
  <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" />
  <transport name="java"  pivot="java:org.apache.axis.transport.java.JavaSender" />

</deployment>

4th, I added commons-codec(Version1.3) and commons-httpclient(Version3.1) to build path.

Then, I called my sample with VM argument -Daxis.ClientConfigFile=client-config.wsdd.

I watch the request and response by tcpmon included in Axis. The result is

Request Header:
CONNECT na6-api.salesforce.com:443 HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: xxxxx.yyy:8088
Proxy-Connection: Keep-Alive

 
Response Header:
HTTP/1.1 200 Connection established

There is no elements about compression in headers.
Please let me know what's wrong.

thanks.

SuperfellSuperfell
because all you're seeing is the connection to the proxy that sets up the SSL tunnel. everything of interest, including the compression stuff, is in subsequent encrypted traffic.
ostateostate
Hi Simon, thanks for your reply.

Do you have any idea to see if compression is available?
If you have, please let me know.

   I tried to capture packet between my pc and proxy.
   But both no-compression and compression,
   the amount size of packet is almost the same.

Very Thanks,
ostate