Package org.apache.axis2.mtompolicy
Class Utils
java.lang.Object
org.apache.axis2.mtompolicy.Utils
This is a MTOM module utility class. It contains some useful methods used into the MTOM module.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyPolicyToSOAPBindings(AxisService axisService, org.apache.neethi.Policy policy) Applies the MTOM policy to the binding level of the web service.static MTOMAssertiongetMTOMAssertion(AxisDescription axisDescription) Extracts the MTOM assertion object if it is exists into the policy based on a givenAxisDescription.static org.apache.neethi.PolicygetMTOMPolicy(Parameter param) Based on the parameter passed aMTOM10Assertionobject is created by default.static AxisServicelocateAxisService(AxisDescription axisDescription) Locates theAxisServiceobject searching up in the hierarchy recursively theAxisDescriptionobject passed.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getMTOMAssertion
Extracts the MTOM assertion object if it is exists into the policy based on a givenAxisDescription.- Parameters:
axisDescription- theAxisDescriptionobject that should be searched.- Returns:
MTOMAssertiontheMTOMAssertionfound. If it is not found "null" is returned.
-
locateAxisService
Locates theAxisServiceobject searching up in the hierarchy recursively theAxisDescriptionobject passed.- Parameters:
axisDescription- theAxisDescriptionobject that should be checked.- Returns:
- the
AxisServiceobject found or "null".
-
getMTOMPolicy
Based on the parameter passed aMTOM10Assertionobject is created by default. Then it is added to aPolicyobject and returned.- Parameters:
param- theParameterobject that contains the value of the "enableMTOM" parameter: "true" or "optional".- Returns:
- The
Policyobject for the MTOM assertion.
-
applyPolicyToSOAPBindings
public static void applyPolicyToSOAPBindings(AxisService axisService, org.apache.neethi.Policy policy) throws AxisFault Applies the MTOM policy to the binding level of the web service.- Parameters:
axisService- theAxisServiceto whom binding level the MTOM policy should be attached.policy- thePolicyobject that contains the MTOM assertion.- Throws:
AxisFault- thrown if the parameter is locked on a parent level - thus it could not be added.
-