You could either:

Use gzip compression:

http://wiki.apache.org/ws/FrontPage/Axis/GzipCompression

Or just do getBytes() on the string and compress the byte array:

http://javaalmanac.com/egs/java.util.zip/CompArray.html

HTH,
Robert
http://www.braziloutsource.com/

On 4/17/06, Jan Krumsiek <[EMAIL PROTECTED]> wrote:
Hello.

I am currently using a JWS Web Service to provide an web interface to an EJB. I know, JWS Services are simple and primitive, but it should be enough for this simple redirection purpose.

Below is message I posted one example how I am calling the Web Service from the client side. Now, is there any way to the the Axis packages do automatic base64 encoding and/or compression of the String data?

Many thanks in advance,

Jan


Code:

public static String getMatrixChunk(String sessionID, int elements) throws MalformedURLException, ServiceException, RemoteException {
        Call call = getStandardCall("getMatrixChunk");
        call.addParameter("op1", XMLType.XSD_STRING, ParameterMode.IN );
         call.addParameter("op2", XMLType.XSD_INT, ParameterMode.IN );
        call.setReturnType(XMLType.XSD_STRING );
        // base64 decode the result
        return (String)Base64.decodeToObject((String) call.invoke ( new Object [] { sessionID, new Integer(elements) }));
}

private static Call getStandardCall(String methodName) throws ServiceException, MalformedURLException {
        Service service = new Service();
        Call call = (Call)service.createCall();

        call.setTargetEndpointAddress(new URL(END_POINT));
        call.setOperationName(methodName);

        return call;
}




_________________________________________________________________
versendet mit www.Oleco.de Mail - Anmeldung und Nutzung kostenlos!
Oleco www.netlcr.de jetzt auch mit SPAMSCHUTZ.




Reply via email to