2 Replies Latest reply on Aug 17, 2008 2:07 AM by ken

    mtom on the server

    ken Newbie

      If I want to make mtom optional on the server, what is the best way of configuring that? Is there any way to package the BindingType outside the webservice class, so that users can turn mtom on or off?

        • 1. Re: mtom on the server
          Vladyslav Kosulin Newbie

          Do you mean, for some client you want to use SOAP with attachments, and for others - MTOM? I do not believe you can enable or do this dynamically, because it is part of the service endpoint contract definition.
          What we do, we have only one XML atttribute defined as @XmlMimeType("application/zip") and at the same time as @XmlElement(..., required=false). As a result, when this attribute is not null, it is sent using MTOM, and when it is null it is absent from response, and there is no MTOM encoding in this response.

          • 2. Re: mtom on the server
            ken Newbie

            I am concerned if a client can not process mtom encoded attachments, so I like to make mtom optional on the server. (this is an in-house application, so customers will have control over the server) So when server is not mtom-enabled, attachment is send inline.
            The javadoc for BindingType annotation states that the annotation may be overriden programmatically. I was thinking maybe I can use that to read mtom configuration from a properties file, but I am not sure how do that.