Thanks for your hints, it has solved my issue!
Jean-Noel
From: Michael Becke <[EMAIL PROTECTED]> on 22/01/2004 10:09 EST
Please respond to Commons HttpClient Project
<[EMAIL PROTECTED]>
To: Commons HttpClient Project
<[EMAIL PROTECTED]
ache.org>
cc:
Subjec Re: HttpClient 2.0 rc3:
t: java.io.StreamCorruptedException
Hi Joel,
Please take a look at the SSL guide for an example of how to use an SSL
proxy <http://jakarta.apache.org/commons/httpclient/sslguide.html>.
Generally speaking you do not want to manually create and use the
ConnectMethod. This is handled by HttpClient.execute().
Mike
On Jan 22, 2004, at 8:45 AM, Jean-Noel Heyraud wrote:
>
> Hi All,
>
> I 've tried to port my application from java.io.* to httpClient.
> Everything
> works fine (http, https), except when my client need to communication
> via a
> proxy (no need to set user or password) using SSL.
>
> any idea?
>
> PostMethod postMethod = new PostMethod(URI);
>
> file = new File(fileName);
> postMethod.setRequestBody(new FileInputStream(file));
> postMethod.setRequestContentLength((int)file.length());
>
> if (connection.isProxied() && connection.isSecure()) {
> postMethod = new ConnectMethod(postMethod);
> }
>
> postMethod.execute(httpState,connection);
> if (postMethod.getStatusCode() == HttpStatus.SC_OK) {
> ObjectInputStream fromETravel = new
> ObjectInputStream(postMethod.getResponseBodyAsStream());
>
>
> <Thu Jan 22, 2004 14:26:49 CET> [JCO.ServerThread-1] ERROR
> com.amadeus.sap
> - [ETravelBridgeClient] InputStream does not contain a serialized
> object
> java.io.StreamCorruptedException: InputStream does not contain a
> serialized
> object
> at
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:844)
> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:163)
> at
> com.amadeus.sap.client.rfc.AbstractETravelBridgeClient$ConnectionListen
> er.sendRFC4Process(AbstractETravelBridgeClient.java:398)
> at
> com.amadeus.sap.client.rfc.AbstractETravelBridgeClient$ConnectionListen
> er.handleRequest(AbstractETravelBridgeClient.java:347)
> at com.sap.mw.jco.JCO$Server.dispatchRequest(Unknown Source)
> at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native
> Method)
> at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(Unknown Source)
> at com.sap.mw.jco.JCO$Server.listen(Unknown Source)
> at com.sap.mw.jco.JCO$Server.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:479)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]