i've tried that

byte [] a = ((String) call.invoke(new Object[] {uncompressed})).getBytes();

but when i use a in the next call it just hangs

String st = (String) call1.invoke(new Object[] {a});



From: Michael <[EMAIL PROTECTED]>
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: help with byte[]
Date: Wed, 8 Mar 2006 17:07:35 +0000

String.getBytes()?

On 08/03/06, Plorks mail <[EMAIL PROTECTED]> wrote:
>
>
> i have these methods
>
> public static byte[] compress(String string) throws IOException
> {
> ...
> byte[] compressedData = bos.toByteArray();
> return compressedData
> }
>
>
> public static String unCompress(byte [] bytes)
> {
> ...
> byte[] decompressedData = bos.toByteArray();
> String uncompressed = new String(decompressedData);
> return uncompressed;
> }
>
> Created a webservice in the wsdl i have this
> ...
>
> - <element name="compressResponse">
> - <complexType>
> - <sequence>
>   <element name="compressReturn" type="xsd:base64Binary" />
>   </sequence>
>   </complexType>
>   </element>
>
> ...
>
>
> when i call the WS i get a null value
>
> Service service = new Service();
>
> Call call = (Call) service.createCall();
>
> call.setTargetEndpointAddress(endpoint);
>
> call.setOperationName("squashString");
>
> byte[] bytes = (byte[]) call.invoke(new Object[] {uncompressed});
>
>
> but if i do this (call.invoke(new Object[] {uncompressed})) and inspect the
> result i get what i expect
>
>
> if i do this System.out.println(call.invoke(new Object[]
> {uncompressed}).getClass());
>
> is comes back as class java.lang.String
>
> i need to return a byte[] from the call. i need to use the byte [] in the
> next call unCompress
>
> can someone show me how i convert a string to a byte[] so i can use it in
> the next method
>
> Can anyone help me out as i'm a bit stuck
>
> many thanks
>
> _________________________________________________________________
> The new MSN Search Toolbar now includes Desktop search!
> http://toolbar.msn.co.uk/
>
>

_________________________________________________________________
Are you using the latest version of MSN Messenger? Download MSN Messenger 7.5 today! http://messenger.msn.co.uk

Reply via email to