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();
}