javax.xml.ws.soap.MTOMFeature Java Examples

The following examples show how to use javax.xml.ws.soap.MTOMFeature. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MtomFeatureConfigurator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process Mtom policy assertions and if found and is not optional then mtom is enabled on the
 * {@link WSDLBoundPortType}
 *
 * @param key Key that identifies the endpoint scope
 * @param policyMap Must be non-null
 * @throws PolicyException If retrieving the policy triggered an exception
 */
public Collection<WebServiceFeature> getFeatures(PolicyMapKey key, PolicyMap policyMap) throws PolicyException {
    final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    if ((key != null) && (policyMap != null)) {
        Policy policy = policyMap.getEndpointEffectivePolicy(key);
        if (null!=policy && policy.contains(OPTIMIZED_MIME_SERIALIZATION_ASSERTION)) {
            Iterator <AssertionSet> assertions = policy.iterator();
            while(assertions.hasNext()){
                AssertionSet assertionSet = assertions.next();
                Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
                while(policyAssertion.hasNext()){
                    PolicyAssertion assertion = policyAssertion.next();
                    if(OPTIMIZED_MIME_SERIALIZATION_ASSERTION.equals(assertion.getName())){
                        features.add(new MTOMFeature(true));
                    } // end-if non optional mtom assertion found
                } // next assertion
            } // next alternative
        } // end-if policy contains mtom assertion
    }
    return features;
}
 
Example #2
Source File: WebServiceFeatureList.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #3
Source File: WebServiceFeatureList.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #4
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #5
Source File: Packet.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean shouldUseMtomOutbound() {
    //Use the getter to make sure all the logic is executed correctly
    MTOMFeature myMtomFeature = getMtomFeature();
    if(myMtomFeature != null && myMtomFeature.isEnabled()) {
        //On client, always use XOP encoding if MTOM is enabled
        //On Server, mtomAcceptable and mtomRequest will be set - use XOP encoding
        //if either request is XOP encoded (mtomRequest) or
        //client accepts XOP encoding (mtomAcceptable)
        if (getMtomAcceptable() == null && getMtomRequest() == null) {
            return true;
        } else {
            if (getMtomAcceptable() != null &&  getMtomAcceptable() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ClientRequest)) {
                return true;
            }
        }
    }
    return false;
}
 
Example #6
Source File: Packet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private boolean shouldUseMtomOutbound() {
    //Use the getter to make sure all the logic is executed correctly
    MTOMFeature myMtomFeature = getMtomFeature();
    if(myMtomFeature != null && myMtomFeature.isEnabled()) {
        //On client, always use XOP encoding if MTOM is enabled
        //On Server, mtomAcceptable and mtomRequest will be set - use XOP encoding
        //if either request is XOP encoded (mtomRequest) or
        //client accepts XOP encoding (mtomAcceptable)
        if (getMtomAcceptable() == null && getMtomRequest() == null) {
            return true;
        } else {
            if (getMtomAcceptable() != null &&  getMtomAcceptable() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ClientRequest)) {
                return true;
            }
        }
    }
    return false;
}
 
Example #7
Source File: WebServiceFeatureList.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #8
Source File: MtomPolicyMapConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #9
Source File: MtomFeatureConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process Mtom policy assertions and if found and is not optional then mtom is enabled on the
 * {@link WSDLBoundPortType}
 *
 * @param key Key that identifies the endpoint scope
 * @param policyMap Must be non-null
 * @throws PolicyException If retrieving the policy triggered an exception
 */
public Collection<WebServiceFeature> getFeatures(PolicyMapKey key, PolicyMap policyMap) throws PolicyException {
    final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    if ((key != null) && (policyMap != null)) {
        Policy policy = policyMap.getEndpointEffectivePolicy(key);
        if (null!=policy && policy.contains(OPTIMIZED_MIME_SERIALIZATION_ASSERTION)) {
            Iterator <AssertionSet> assertions = policy.iterator();
            while(assertions.hasNext()){
                AssertionSet assertionSet = assertions.next();
                Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
                while(policyAssertion.hasNext()){
                    PolicyAssertion assertion = policyAssertion.next();
                    if(OPTIMIZED_MIME_SERIALIZATION_ASSERTION.equals(assertion.getName())){
                        features.add(new MTOMFeature(true));
                    } // end-if non optional mtom assertion found
                } // next assertion
            } // next alternative
        } // end-if policy contains mtom assertion
    }
    return features;
}
 
Example #10
Source File: WebServiceFeatureList.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #11
Source File: Packet.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private boolean shouldUseMtomOutbound() {
    //Use the getter to make sure all the logic is executed correctly
    MTOMFeature myMtomFeature = getMtomFeature();
    if(myMtomFeature != null && myMtomFeature.isEnabled()) {
        //On client, always use XOP encoding if MTOM is enabled
        //On Server, mtomAcceptable and mtomRequest will be set - use XOP encoding
        //if either request is XOP encoded (mtomRequest) or
        //client accepts XOP encoding (mtomAcceptable)
        if (getMtomAcceptable() == null && getMtomRequest() == null) {
            return true;
        } else {
            if (getMtomAcceptable() != null &&  getMtomAcceptable() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ClientRequest)) {
                return true;
            }
        }
    }
    return false;
}
 
Example #12
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #13
Source File: Packet.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private boolean shouldUseMtomOutbound() {
    //Use the getter to make sure all the logic is executed correctly
    MTOMFeature myMtomFeature = getMtomFeature();
    if(myMtomFeature != null && myMtomFeature.isEnabled()) {
        //On client, always use XOP encoding if MTOM is enabled
        //On Server, mtomAcceptable and mtomRequest will be set - use XOP encoding
        //if either request is XOP encoded (mtomRequest) or
        //client accepts XOP encoding (mtomAcceptable)
        if (getMtomAcceptable() == null && getMtomRequest() == null) {
            return true;
        } else {
            if (getMtomAcceptable() != null &&  getMtomAcceptable() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ServerResponse)) {
                return true;
            }
            if (getMtomRequest() != null && getMtomRequest() && getState().equals(State.ClientRequest)) {
                return true;
            }
        }
    }
    return false;
}
 
Example #14
Source File: WebServiceFeatureList.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param endpointClass web service impl class
 */
public void parseAnnotations(Class<?> endpointClass) {
    for (Annotation a : endpointClass.getAnnotations()) {
        WebServiceFeature ftr = getFeature(a);
        if (ftr != null) {
            if (ftr instanceof MTOMFeature) {
                // check conflict with @BindingType
                BindingID bindingID = BindingID.parse(endpointClass);
                MTOMFeature bindingMtomSetting = bindingID.createBuiltinFeatureList().get(MTOMFeature.class);
                if (bindingMtomSetting != null && bindingMtomSetting.isEnabled() ^ ftr.isEnabled()) {
                    throw new RuntimeModelerException(
                        ModelerMessages.RUNTIME_MODELER_MTOM_CONFLICT(bindingID, ftr.isEnabled()));
                }
            }
            add(ftr);
        }
    }
}
 
Example #15
Source File: MtomFeatureConfigurator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process Mtom policy assertions and if found and is not optional then mtom is enabled on the
 * {@link WSDLBoundPortType}
 *
 * @param key Key that identifies the endpoint scope
 * @param policyMap Must be non-null
 * @throws PolicyException If retrieving the policy triggered an exception
 */
public Collection<WebServiceFeature> getFeatures(PolicyMapKey key, PolicyMap policyMap) throws PolicyException {
    final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    if ((key != null) && (policyMap != null)) {
        Policy policy = policyMap.getEndpointEffectivePolicy(key);
        if (null!=policy && policy.contains(OPTIMIZED_MIME_SERIALIZATION_ASSERTION)) {
            Iterator <AssertionSet> assertions = policy.iterator();
            while(assertions.hasNext()){
                AssertionSet assertionSet = assertions.next();
                Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
                while(policyAssertion.hasNext()){
                    PolicyAssertion assertion = policyAssertion.next();
                    if(OPTIMIZED_MIME_SERIALIZATION_ASSERTION.equals(assertion.getName())){
                        features.add(new MTOMFeature(true));
                    } // end-if non optional mtom assertion found
                } // next assertion
            } // next alternative
        } // end-if policy contains mtom assertion
    }
    return features;
}
 
Example #16
Source File: MtomFeatureConfigurator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * process Mtom policy assertions and if found and is not optional then mtom is enabled on the
 * {@link WSDLBoundPortType}
 *
 * @param key Key that identifies the endpoint scope
 * @param policyMap Must be non-null
 * @throws PolicyException If retrieving the policy triggered an exception
 */
public Collection<WebServiceFeature> getFeatures(PolicyMapKey key, PolicyMap policyMap) throws PolicyException {
    final Collection<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
    if ((key != null) && (policyMap != null)) {
        Policy policy = policyMap.getEndpointEffectivePolicy(key);
        if (null!=policy && policy.contains(OPTIMIZED_MIME_SERIALIZATION_ASSERTION)) {
            Iterator <AssertionSet> assertions = policy.iterator();
            while(assertions.hasNext()){
                AssertionSet assertionSet = assertions.next();
                Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
                while(policyAssertion.hasNext()){
                    PolicyAssertion assertion = policyAssertion.next();
                    if(OPTIMIZED_MIME_SERIALIZATION_ASSERTION.equals(assertion.getName())){
                        features.add(new MTOMFeature(true));
                    } // end-if non optional mtom assertion found
                } // next assertion
            } // next alternative
        } // end-if policy contains mtom assertion
    }
    return features;
}
 
Example #17
Source File: MtomPolicyMapConfigurator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #18
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #19
Source File: MtomCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WSFeatureList features){
    super(version, features);
    this.codec = codec;
    sf = features.get(SerializationFeature.class);
    MTOMFeature mtom = features.get(MTOMFeature.class);
    if(mtom == null)
        this.mtomFeature = new MTOMFeature();
    else
        this.mtomFeature = mtom;
}
 
Example #20
Source File: RuntimeModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example #21
Source File: BindingID.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public WebServiceFeatureList createBuiltinFeatureList() {
    WebServiceFeatureList r=super.createBuiltinFeatureList();
    Boolean mtom = isMTOMEnabled();
    if(mtom != null)
        r.add(new MTOMFeature(mtom));
    return r;
}
 
Example #22
Source File: SOAPBindingCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Should be called after decode().
     * Set the state so that such state is used by encode().
     */
    private void postDecode(Packet p) {
        p.setFastInfosetDisabled(isFastInfosetDisabled);
        if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable();
//            p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) );
        MTOMFeature mtomFeature = features.get(MTOMFeature.class);
        if (mtomFeature != null) {
            p.setMtomFeature(mtomFeature);
        }
        if (!useFastInfosetForEncoding) {
            useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType);
//          useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes);
        }
    }
 
Example #23
Source File: RuntimeModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example #24
Source File: RuntimeModeler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private BindingID getDefaultBindingID() {
BindingType bt = getAnnotation(portClass, BindingType.class);
if (bt != null) return BindingID.parse(bt.value());
SOAPVersion ver = getSoapVersion(features);
boolean mtomEnabled = features.isEnabled(MTOMFeature.class);
if (SOAPVersion.SOAP_12.equals(ver)) {
    return (mtomEnabled) ? BindingID.SOAP12_HTTP_MTOM : BindingID.SOAP12_HTTP;
} else {
    return (mtomEnabled) ? BindingID.SOAP11_HTTP_MTOM : BindingID.SOAP11_HTTP;
}
}
 
Example #25
Source File: Packet.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public MTOMFeature getMtomFeature() {
    //If we have a binding, use that in preference to an explicitly
    //set MTOMFeature
    WSBinding binding = getBinding();
    if (binding != null) {
        return binding.getFeature(MTOMFeature.class);
    }
    return mtomFeature;
}
 
Example #26
Source File: MessageContextFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Packet packet(Message m) {
    final Packet p = new Packet();
    //TODO when do we use xmlCodec?
    p.codec = soapCodec;
    if (m != null) p.setMessage(m);
    MTOMFeature mf = features.get(MTOMFeature.class);
    if (mf != null) {
        p.setMtomFeature(mf);
    }
    return p;
}
 
Example #27
Source File: SOAPBindingCodec.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Should be called after decode().
     * Set the state so that such state is used by encode().
     */
    private void postDecode(Packet p) {
        p.setFastInfosetDisabled(isFastInfosetDisabled);
        if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable();
//            p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) );
        MTOMFeature mtomFeature = features.get(MTOMFeature.class);
        if (mtomFeature != null) {
            p.setMtomFeature(mtomFeature);
        }
        if (!useFastInfosetForEncoding) {
            useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType);
//          useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes);
        }
    }
 
Example #28
Source File: MtomCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WSFeatureList features){
    super(version, features);
    this.codec = codec;
    sf = features.get(SerializationFeature.class);
    MTOMFeature mtom = features.get(MTOMFeature.class);
    if(mtom == null)
        this.mtomFeature = new MTOMFeature();
    else
        this.mtomFeature = mtom;
}
 
Example #29
Source File: Packet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public MTOMFeature getMtomFeature() {
    //If we have a binding, use that in preference to an explicitly
    //set MTOMFeature
    WSBinding binding = getBinding();
    if (binding != null) {
        return binding.getFeature(MTOMFeature.class);
    }
    return mtomFeature;
}
 
Example #30
Source File: BindingID.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public WebServiceFeatureList createBuiltinFeatureList() {
    WebServiceFeatureList r=super.createBuiltinFeatureList();
    Boolean mtom = isMTOMEnabled();
    if(mtom != null)
        r.add(new MTOMFeature(mtom));
    return r;
}