Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MTOM example

 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am running Ivan's example which is in 10.3 section. below is my wsdl



When i run the example in SOAPUI i got back bytes in response but attachment tab hadnothing in it. Only header tab has 6 properties. Am i missing something? i see the poseted wsdl in chapter and i have difference in policy tag also. Why is it so?

Thanks in advance
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The policy declaration you have do look fine. It is not exactly match that in my book, but I think it is equivalent.
Are you deploying the service to GlassFish and if so, which version?
There may be some differences between, say, GlassFish 2 (which I used when writing the book) and GlassFish v3.
If you let me know what version you are using, I can try the service here.
Also, have you tried to run the client? With what result?
Best wishes!
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using glassfishv3 version. I have not tried other client, i used on soapui. I will give it a try but how to verify if respnose contains attachment. should i use TCP/IP monitoring tool.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
It turns out that the way I used to read the picture files, which worked fine in GlassFish v2, do not work in GlassFish v3.
I have corrected the retrievePicture method and the new version looks like this:

Thanks for pointing this problem out to me.
Best wishes!
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still no luck for me, I still got response but not attchment with new example also.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
GlassFish v3 has apparently changed what is the result of enabling MTOM in a service.
As you correctly point out, the policy declaration is different and if you look even closer, you can see that MTOM is no longer mandatory, but optional:

This causes soapUI to choose not to use MTOM when interacting with the service and thus you see no attachments in soapUI.
When I just tried the client program, shown later in section 10.3, and used a packet sniffer to examine the communication with the web service, then I found that MTOM was indeed enabled.
I will make updates to my study guide when I have time and when I have thought a little about the best way to write about this to cover both GlassFish v2 and v3.
Best wishes!

P.S. The client program seems to have a problem displaying the fetched picture now and then, I will look into this as well (guess I need to brush up my old Swing knowledge. ).
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
This fixes the client program (exchange the method with the same name for the new version below):

Best wishes!
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Ah, finally! :-)
I managed to change the settings of the request in soapUI so that MTOM is forced, see picture below.
This way, you will get to see the attachment, as described in the tutorial!
Best wishes!
soapUI-requestproperties.jpg
[Thumbnail for soapUI-requestproperties.jpg]
soapUI Request Properties pane in which to force MTOM
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes... that works by chaning properties in soapui. Thanks alot for your help.
 
Fabio Spadaro
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ivan Krizsan wrote:Hi!
Ah, finally! :-)
I managed to change the settings of the request in soapUI so that MTOM is forced, see picture below.
This way, you will get to see the attachment, as described in the tutorial!
Best wishes!

Hi, it does work for me too but in the soapui the content-type of attachement is image/png instead of image/jpeg. Why?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic