Sorry I haven't describe the details for the problem; some other details
relate to the problem as following: 

1) To check if http-connection is closed correctly, a more easy way is
disable keep-alive option at client; and invoke the web-service repeatly.
Then you will find many "CLOSE_WAITING" or "FIN_WAITING" socket. (CAUTION:
NOT "TIME_WAITING" status)
2) By the way, if the attachment is bigger than 64K, and we doesn't consume
the attachment's input stream, just close it. 
Then the temporary file of first attachment will be left on disk and keep
open until the web service client's jvm exit;

3) The CXF version is 2.3.3

> -----original-----
> Sender: ext2 [mailto:[email protected]]
> Time: 2011/5/6 0:00
> Receiver: [email protected]
> Subject: MTOM Attament Cleaning Problems / Bugs ?
> 
> Hi:
> When webservice client receiving the MTOM reponse(which  have more than
one
> attachments), the client cannot release Http-Connection correctly;
> 
> In my program all DataHandler's input stream have been consumed and closed
> correctly; but the http-connection still cannot be released correctly;
> 
> the import thing is : if we only have one attachment, the http-connection
> can be released correctly. But more than one attachments, cannot release
> http-connection correctly;
> 
> 
> Following is a simple example for illustrate the wsdl and clients:
> MTOM Reponse Schema:
> <complexType name="DataHandlerType2">
>  <sequence>
>   <element name="nameR" type="xsd:string" />
>   <element name="attachinfoR1" type="xsd:base64Binary"
> xmime:expectedContentTypes="application/octet-stream"/>
> <element name="attachinfoR2" type="xsd:base64Binary"
> xmime:expectedContentTypes="application/octet-stream"/>
> </sequence>
> </complexType>
> 
> 
> Program is :
> 
> ...do webservice invoke and got the reply
> is = reply.getAttachinfoR1().getDataSource().getInputStream();
> readClose(is);
> is = reply.getAttachinfoR2().getDataSource().getInputStream();
> readClose(is);
> 
> private void readClose(InputStream is) throws IOException {
>       while(is.read() != -1)
>               ;
>     is.close();
> }
> 
> 
> 



Reply via email to