wood burning stoves 2.0*
The moose likes Web Services and the fly likes Axis2: Enforce incoming messages must be MTOMised Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2: Enforce incoming messages must be MTOMised" Watch "Axis2: Enforce incoming messages must be MTOMised" New topic
Author

Axis2: Enforce incoming messages must be MTOMised

sin pillai
Greenhorn

Joined: Mar 30, 2010
Posts: 5
Hi,

I am exploring MTOM to send binary attachment to service using Axis2 (1.6.2). I was able to get my sample example working.
However, the problem i am facing is how to enforce that incoming messages must be MTOMised (prevent client from sending binary data embedded in message)

I tried using WS-MTOMPolicy assertion in the WSDL

Below is snippet:

<wsp:Policy wsu:Id="wsmtom_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" />
</wsp:Policy>

and attached it to binding

<wsp:PolicyReference URI="#wsmtom_policy" wsdl:required="true"></wsp:PolicyReference>


I assumed that client will receive an exception when it tries to send the binary data as base64 encoded in request.. But found that
it didnt happen. The server accepted both base64 and MTOM message.

I then tried setting the attribute optional=false,
<wsoma:optimizedmimeserialization optional="false">
That didnt work.


Next, i tried to add WS-MTOMPolicy to service.xml. That didnt work either.


I am not sure if my understanding is incorrect or if there is any actually a way do such an enforcement on incoming message.


Appreciate any pointer or help.

Thanks,
Sindhu

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis2: Enforce incoming messages must be MTOMised