File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes MTOM policy in WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "MTOM policy in WSDL " Watch "MTOM policy in WSDL " New topic

MTOM policy in WSDL

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1341

If I define @MTOM annotation on SIB, I get below shown mtom policy in wsdl
<wsp:Policy wsu:Id="CustomMTOMImageWSPortBinding_MTOM_Policy"><ns1:OptimizedMimeSerialization wsp:Optional="true"/></wsp:Policy>

But I define @MTOM on SEI (not on SIB but SIB do refer to SEI through 'endpointInterface') , I do not get above mentioned mtom policy definition in WSDL.
Any specific why we have this behaviour?
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 2041

According to the API:

This annotation MUST only be used in conjunction the javax.jws.WebService, WebServiceProvider, WebServiceRef annotations. When used with the javax.jws.WebService annotation this annotation MUST only be used on the service endpoint implementation class. When used with a WebServiceRef annotation, this annotation MUST only be used when a proxy instance is created. The injected SEI proxy, and endpoint MUST honor the values of the MTOM annotation.

In short: it should be on the SIB. On the SEI it will be ignored.
I agree. Here's the link:
subject: MTOM policy in WSDL
It's not a secret anymore!