Problems with DirectAction Response header

From: Frederico Lellis (frederico.lelli..mail.com)
Date: Tue May 22 2007 - 15:34:41 EDT

  • Next message: Frederico Lellis: "Re: Problems with DirectAction Response header"

    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: frederic..oleque.com.br

    frederico.lelli..mail.com

    ******************************************************



    This archive was generated by hypermail 2.0.0 : Tue May 22 2007 - 15:35:43 EDT