2009-08-07 2 views
0

Ich möchte GZIP für SOAPMessage implementieren. ist unter dem normalen SOAP-Client-Anruf-Code -SOAPMessage GZIP-Implementierung

// 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); 

Wie ich GZIP in Soapmessage in oben genannten Code implementieren kann. Ich habe Google dafür googeln, aber habe keine nützlichen Dinge gefunden.

Bitte beraten, wie kann ich es SOAPMessage implementieren.

+0

Was ist Soapclient? – skaffman

+0

Oben angegebenes Beispiel ist der SOAP-Nachricht mit SAAJ – Santosh

Antwort

0

Probieren Sie etwas wie die nach den Accept-Encoding-Header zu setzen:

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

geben unlesbare Antwort in JDK 1.6