Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MTOM in JAX-WS

 
Janardan Kelkar
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a service that accepts and returns binary data. The client sends a file to the service and the service in turn, returns the same file back to the client. I have annotated the service implementation class with @MTOM, and i see that MTOM is enabled when i deploy the service to the server (in the server's logs). However, when i test the same with my client (with MTOM enabled) the file is not going through. When i invoke the service without MTOM enabled in the client, the file is reaching the server, but the client is unable to receive the file from the server.
When i disable MTOM in the service and redeploy the same, i am able to see the file go through to the server and receive the same @the client (with MTOM disabled). I dont see any logs on the server when i invoke with an MTOM enabled client. Any suggestions about what i could be doing wrong ?

Enabling MTOM in server:


Enabling MTOM in client:


I am using JBoss AS 7 for my server.

Thanks!
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try




?

Does any error show up in syslog ? What os are you running the AS on ?
 
Janardan Kelkar
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i did. And then i also tried using it alongwith @MTOM.
I am not getting any error anywhere, the client and the service run successfully. However, the files that are received by the server (from the client) and the client (from the server) are empty.
Here's the flow:
1) Client sends file to the service.
2) The service receives the file and writes it to disk.
3) The service then returns the same file (the same javax.activation.DataHandler object) back to the client.
4) The client writes the file back to disk.

After running the client, when i see the two files written by the server and the client, i see the files created on the disk but the size is 0.

When i disable MTOM just on the client, the file is reaching the server, because the file written by it is then of the correct size, however, the file written by the client is 0.
When i disable MTOM both on the client and the server, both files are getting created with the correct size.

I am running the server on windows 7 64bit.
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue is likely with the demarshaller not handling the octet stream properly. Take a look at this page to see if you can spot something you have not done yet. JAX-B has a defect currently in that the only MIME type that is supported is 'application/octet-stream'. In theory, you could use any one you want, but this is not the case currently.

You might also want to post a bug in the Apache issues tracker : https://issues.apache.org/jira/browse/CXF

Here is a similar bug report : https://issues.apache.org/jira/browse/CXF-3383



 
brevity is the soul of wit - shakepeare. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!