This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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.
 
Similar Threads
MTOM not working in Axis2
logging lifecyle events of servlet
about J2EE 1.4 Application Server
Can't connect to MySQL database with Hibernate
sending pdf or any attachment from a java webservice to java client using JAX-WS and SAAJ