aspose file tools*
The moose likes Web Services and the fly likes When use mtom to transfer one file, server log shows the file is accessed twice. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "When use mtom to transfer one file, server log shows the file is accessed twice. " Watch "When use mtom to transfer one file, server log shows the file is accessed twice. " New topic
Author

When use mtom to transfer one file, server log shows the file is accessed twice.

Jeffery Yuan
Greenhorn

Joined: Nov 06, 2011
Posts: 1
Hi, all:
I found out that when I use jax-ws mtom to transfer file, the server log shows that the file is accessed twice - I tested the sample in both glassfish and jboss server.

The test code is like this:

Web service code:


Web service client code:

When I try to get one small file, about 2 kb, the following line would be recorded in localhost_access_log:
127.0.0.1 - - [03/Nov/2011:15:04:49 +0800] "GET /file HTTP/1.1" 200 1748
127.0.0.1 - - [03/Nov/2011:15:04:49 +0800] "GET /file HTTP/1.1" 200 1748
===> accessed twice.
10.32.98.213 - - [03/Nov/2011:15:04:49 +0800] "POST /example-ws/GetContentService HTTP/1.1" 200 25700

When I try to get one big file - 3074 k, the following line would be recorded in localhost_access_log:
127.0.0.1 - - [03/Nov/2011:15:10:38 +0800] "GET /file HTTP/1.1" 200 3147690
10.32.98.213 - - [03/Nov/2011:15:10:38 +0800] "POST /example-ws/GetContentService HTTP/1.1" 200 3148515
127.0.0.1 - - [03/Nov/2011:15:10:42 +0800] "GET /file HTTP/1.1" 200 40960
=====> accessed twisce, but the size of the get request is much smaller.

This should be related how mtom and datahandler is implemented in jax-ws.
I am wondering why the file is accessed twice, and is this expected behavior or not?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When use mtom to transfer one file, server log shows the file is accessed twice.