Skip to main content

Forcing Responses as MTOM Packages

Forcing Responses as MTOM Packages

You can force an InterSystems IRIS web service to send every response as an MTOM package. To do, do any of the following:

  • In your InterSystems IRIS web service class, set the MTOMREQUIRED parameter to 1.

  • In your InterSystems IRIS web service instance, set the MTOMRequired property to 1. You can do this within the web method or within the OnPreWebMethod() callback. For an introduction to this callback, see Customizing Callbacks of the Web Service.

  • Attach a policy statement for the web service to send MTOM packages. To do so, you create and compile a configuration class that refers to the web service class; in this policy, enable use of MTOM. See Securing Web Services.

    If you attach such a policy statement, your values for MTOMREQUIRED is ignored, and MTOMRequired is set equal to 1.

Effect on the WSDL

MTOMREQUIRED and MTOMRequired do not affect the WSDL of the web service.

A policy statement that refers to MTOM does affect the WSDL; if you add a policy statement, it is necessary to regenerate any web clients. For an InterSystems IRIS web client, you can simply attach an MTOM policy statement to the client instead of regenerating the client classes.

FeedbackOpens in a new tab