Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 68245 invoked from network); 10 Feb 2005 18:00:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Feb 2005 18:00:09 -0000 Received: (qmail 65567 invoked by uid 500); 10 Feb 2005 17:59:56 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 65520 invoked by uid 500); 10 Feb 2005 17:59:56 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 65505 invoked by uid 99); 10 Feb 2005 17:59:56 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from parfw01-nat.parago.com (HELO PAREXC01.ad.parago.com) (216.206.147.99) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 10 Feb 2005 09:59:54 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [httpclient] How to send and recieve Serialized ObjectusingHttpClient Date: Thu, 10 Feb 2005 11:59:52 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [httpclient] How to send and recieve Serialized ObjectusingHttpClient Thread-Index: AcUO2SjZtMW/2Y0LTeypoT4vqEGbYwAus9yw From: "Sanjeev Tripathi" To: "Jakarta Commons Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Wendy Smoak, These are the steps: In Http Client side: byte[] decodeSevletData =3D org.apache.commons.codec.binary.Base64.decodeBase64(authpost.getResponse Body()); Vector servletVecoter =3D (Vector) SerializationUtils.deserialize(decodeSevletData); =20 for (int i =3D 0; i < servletVecoter.size(); i++) { CommunicationVO vo =3D (CommunicationVO) servletVecoter.get(i); System.out.println("id :" + vo.getSubmissionId() + ": desc:" + vo.getDescription());} In servlet side: com.parago.communication.CommunicationVO commVO1 =3D new com.parago.communication.CommunicationVO(45, "Object1"); com.parago.communication.CommunicationVO commVO2 =3D new com.parago.communication.CommunicationVO(75, "Object2"); Vector commVOVector =3D new Vector(); commVOVector.add(commVO1); commVOVector.add(commVO2); byte[] encodedData =3D Base64.encodeBase64(SerializationUtils.serialize(commVOVector)); // String encodedString =3D new String(encodedData); OutputStream os response.getOutputStream(); Os.write(encodedData); os.flush(); os.close(); return; Please tell me where I can improve this code as its not working. Thanks. Sanjeev Tripathi -----Original Message----- From: Wendy Smoak [mailto:java@wendysmoak.com]=20 Sent: Wednesday, February 09, 2005 12:57 PM To: Jakarta Commons Users List Subject: Re: [httpclient] How to send and recieve Serialized ObjectusingHttpClient From: "Sanjeev Tripathi" > Actually request parameter that I set in HttpCleint I can use in servlet > But > There is no way (or at least I don't know) to retrieve request > attribute/parameter in http client those set in servlet. This is very > simple in jsp but in http client I need to write object to > outputstream{ObjectOutputStream oos =3D new > ObjectOutputStream(response.getOutputStream())} > To work this I need to set content type as follows > response.setContentType("application/octet-stream"); Can you list the steps you're taking, and post the code that is not working? I _think_ you're stuck on sending a base 64 encoded serialized object back to the client, but I'm not certain. If that's the case, please show the server-side code you're using to send the response, and then what you've done on the client. --=20 Wendy Smoak --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org