[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ksoap: Re: Ksoap: running StockQuoteDemo on Palm


Hi,

> > > Yes, the chunked encoding seems responsible for the problem.
> > > Eric Giguere posted on kvm-interest that the problem can be
> > > avoided by not calling flush. Perhaps it's worth a try to
> > > disable the os.flush () line in HttpTransport.
> >
> > That's exactly the solution I found to do it with WTK1.0.3-beta. Avoid chunking.
> 
> Ok, but how do you make sure that the request is actually
> sent? Before I used flush, I tried to close the output
> stream writer, but that seemed to close the connection
> completely without allowing me to read the reply from
> the input stream? Can you give some more details about
> your fix?

With one of the next lines of your HttpTransport you call

  .. = connection.openInputStream()

which ensures, that 

 a) the stream connection is opened [ what is NOT done at the time
    you call Connector.open(url) ]
 b) the request-line (POST, GET, ...) together with any header line
    is transmitted to the server
 c) any data previously written to the connection's output stream
    is really transmitted as payload of a POST request

before giving you access to the input stream.

Thus, the os.flush() is unnecessary. 

This may answer your question raised on KVM-INTEREST [1] as well.

Regards,
Thomas
  
[1]
http://archives.java.sun.com/cgi-bin/wa?A2=ind0108&L=kvm-interest&D=1&O=D&P=96497

-- 
Dipl.-Inform. Thomas Strang  
mailto:thomas.strang@dlr.de  
http://www.dlr.de/kn/kn-s/strang

DLR Oberpfaffenhofen
Institute of Communications and Navigation
PO Box 1116
82230 Wessling-Oberpfaffenhofen
Tel: +49-8153-28-1354      
Fax: +49-8153-28-1871