FileDocCategorySizeDatePackage
MTOMFeature.javaAPI DocJava SE 6 API3242Tue Jun 10 00:27:16 BST 2008javax.xml.ws.soap

MTOMFeature

public final class MTOMFeature extends WebServiceFeature
This feature represents the use of MTOM with a web service.

The following describes the affects of this feature with respect to being enabled or disabled:

  • ENABLED: In this Mode, MTOM will be enabled.
  • DISABLED: In this Mode, MTOM will be disabled

The {@link #threshold} property can be used to set the threshold value used to determine when binary data should be XOP encoded.

since
JAX-WS 2.1

Fields Summary
public static final String
ID
Constant value identifying the MTOMFeature
protected int
threshold
Property for MTOM threshold value. This property serves as a hint when MTOM is enabled, binary data above this size in bytes SHOULD be sent as attachment. The value of this property MUST always be >= 0. Default value is 0.
Constructors Summary
public MTOMFeature()
Create an MTOMFeature. The instance created will be enabled.

    

                  
      
        this.enabled = true;
    
public MTOMFeature(boolean enabled)
Creates an MTOMFeature.

param
enabled specifies if this feature should be enabled or not

        this.enabled = enabled;
    
public MTOMFeature(int threshold)
Creates an MTOMFeature. The instance created will be enabled.

param
threshold the size in bytes that binary data SHOULD be before being sent as an attachment.
throws
WebServiceException if threshold is < 0

        if (threshold < 0)
            throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
        this.enabled = true;
        this.threshold = threshold;
    
public MTOMFeature(boolean enabled, int threshold)
Creates an MTOMFeature.

param
enabled specifies if this feature should be enabled or not
param
threshold the size in bytes that binary data SHOULD be before being sent as an attachment.
throws
WebServiceException if threshold is < 0

        if (threshold < 0)
            throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
        this.enabled = enabled;
        this.threshold = threshold;
    
Methods Summary
public java.lang.StringgetID()
{@inheritDoc}

        return ID;
    
public intgetThreshold()
Gets the threshold value used to determine when binary data should be sent as an attachment.

return
the current threshold size in bytes

        return threshold;