• Post Reply Bookmark Topic Watch Topic
  • New Topic

AXIS2 MTOM issues- any assistance is appreciated.  RSS feed

 
Jack Rodriguez
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am attempting to create a simple web service that returns a specified file and stores it on the calling machine's drive. It seems as though everything works when the file is under 5kb in size; however, if the file grows larger than that, it begins throwing the below error. Does anyone have a suggestion on what I am doing wrong? Please follow my steps to build it below.


Build instructions:

1) Using Eclipse IDE, built a new dynamic web project.
2) wrote the web service class. . Utilizing Axis2 and Tomcat 7. As seen here:



3) Modified the services.xml file to contain:

MTOMFileDownloader.java
---------------------------



4) Built the .aar file and deployed it on service.

5) Used Eclipse to build a web service client. Utilizing Axis2 and Tomcat 7. The below files are generated:

MTOMFileDownloaderCallbackHandler.java
----------------------------------------




MTOMFileDownloaderStub.java
--------------------------------



6) I had to download and reference the apache-mime4j-core-0.7.2.jar file because I was getting missing class errors.

7) Built the client

TestClient.java
---------------------


8) Execute the client. As stated before, it works for files under 5kb. I'm assuming there is a threshold set somewhere for that size.


PLEASE help me! I'd love for input!

Thanks,
Mike
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael, welcome to Javaranch

You have posted over 1200 lines of code, no one is going to read all that and try to figure what is wrong.
What I see in the exception is

You have closed the input stream somewhere earlier and still you are trying to read it. This is my best guess.
 
Jack Rodriguez
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only about 40 lines of code is what needs to be looked at. The other two files were auto-generated by eclipse when I built the web service client.

Mike
 
Jack Rodriguez
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all, I figured out the issue with the above. The auto-generated stub from eclipse has a line "_messageContext.getTransportOut().getSender().cleanup(_messageContext);" That closes the stream prior to the client attempting to read it. If you comment this out, it works properly.

Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!