Реализация SOAPMessage GZIP

Я хочу реализовать GZIP для SOAPMessage. Ниже приведен нормальный код вызова клиента SOAP -

    // Create a new SOAP message from the factory and set the SOAPAction header.

    MessageFactoryImpl factory = new MessageFactoryImpl();
    SOAPMessage soapMsg = factory.createMessage();

    // Set the SOAP envelope contents to our ebXML DOM.

    SOAPPart part = soapMsg.getSOAPPart();
    part.setContent(new DOMSource(docSoapReq));

    // Create a SOAPConnection to send the SOAP request on.

    SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
    SOAPConnection con = conFactory.createConnection();

    // Point to the service we want to call, and then call it.  
    // Store the response in  the "reply" object.

    URLEndpoint endPoint = new URLEndpoint(serviceURL);


    SOAPMessage reply = con.call(soapMsg, endPoint);
    con.close();

    return (reply);

Как я могу реализовать GZIP в SOAPMessage в вышеупомянутом коде. Я сделал для этого гугл, но ничего полезного не нашел.

Посоветуйте, пожалуйста, как я могу реализовать это SOAPMessage.


person Santosh    schedule 07.08.2009    source источник
comment
Выше приведен пример сообщения SOAP с SAAJ.   -  person Santosh    schedule 07.08.2009


Ответы (2)


MimeHeaders headers = soapMsg.getMimeHeaders();
heders.addHeader("Accept-Encoding", "gzip,deflate");

дает нечитаемый ответ в jdk 1.6

person Sona    schedule 23.10.2012

Попробуйте установить заголовок accept-encoding следующим образом:

MimeHeaders headers = soapMsg.getMimeHeaders();
heders.addHeader("Accept-Encoding", "gzip,deflate");
person Moe Matar    schedule 05.07.2011