• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Axis2: Enforce incoming messages must be MTOMised

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

reply
    Bookmark Topic Watch Topic
  • New Topic