cancel
Showing results for 
Search instead for 
Did you mean: 

Second upload only 1kb?

Former Member
0 Kudos

i have a webservice that allows me to upload a file. When i do j-unit tests the upload is always correct. The file is written on the server.

When i try this according the NW2004 file upload/download tutorial then the first upload i do works. The second one works also or so it seems. Since the webservice is successfully executed, but it only writes a file 1000bytes on the server.

When i do a tcpTrace i can see that the total message size is correct ,but the content-length in the soap envelope is only around 1000bytes. This is the problem is guess. But i dont know why is the cause.

has anybody else experienced this also? I dont think this is a WebDynpro problem perse, but like i said, the j-unit test are working everytime.

Thanks all for helping out.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Martijn Koevoets,

Since you have written <b>first upload i do works</b>, the problems seems that memory being used to read file content is not cleared once read functionality is over. Please check it.

Thanks and Regards,

Ganga.

Former Member
0 Kudos

This is what i was thinking too. The code i use to clear the memory and objects i use is like this:

tempFile.delete();

wdContext.currentContextElement().setFileResource(null);

where tempFile is a temporary java.io.File which i create to write the bytes from the FileResource object of the context. This is done with a FileOutputStream object.

The above statements are done after the webservice call. So i woudl think that the memory is cleared and fresh for a new SOAP attachment when another upload begins.