Hi all,
Im trying to set a WOResponse with a stream that conteains a  Vector with
some objects and give it back to my J2me app.
When i run WebObjects app at my local host its all ok, it works fine and the
objects perfectly deserializable at j2me Side, but when i run the WebObjects
App at Server i have this exception:

java.io.UTFDataFormatException

when i will deserialize my Vector like this:

                   raw = new byte[contentlength];
                   length = bais.read( raw );
                   ByteArrayInputStream baip = new ByteArrayInputStream(
raw );
                   ObjectInputStream ois = new ObjectInputStream( baip );
                   reply = (Vector) ois.readObject(); <-- here i have the
exception.

Is there anything i have to set im my DirectAction method, something like
encoding or header?

this s my Method at DirectAction:

public WOActionResults getAssessmentPalmAction() throws IOException
   {

       String filtro = (String) request().formValueForKey( "todo" );

       Vector arg2 = new Vector();

       arg2.addAll( ConversorAssessmentPalm.AssessmentsConvertidos( filtro
) );

       ByteArrayOutputStream baos = new ByteArrayOutputStream();

       ObjectOutputStream oos = new ObjectOutputStream( baos );

       oos.writeObject( arg2 );

       WOResponse response = new WOResponse();

       response.setHTTPVersion( "HTTP/1.0" );
       response.setHeader( "application/octet-stream", "content-type" );
       response.setContentStream( new ByteArrayInputStream(
baos.toByteArray() ), 8192, baos.size() );
       return response;
}

ty all.


--
--
******************************************************

Frederico L. Albuquerque

\o/
|    Moleque de Idéias Educação e Tecnologia Ltda
/ \

e-mail: [EMAIL PROTECTED]

[EMAIL PROTECTED]

******************************************************
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to