Java 类javax.xml.ws.WebServiceFeature 实例源码

项目:lams    文件:AbstractJaxWsServiceExporter.java   
private WebServiceFeature convertWebServiceFeature(Object feature) {
    Assert.notNull(feature, "WebServiceFeature specification object must not be null");
    if (feature instanceof WebServiceFeature) {
        return (WebServiceFeature) feature;
    }
    else if (feature instanceof Class) {
        return (WebServiceFeature) BeanUtils.instantiate((Class<?>) feature);
    }
    else if (feature instanceof String) {
        try {
            Class<?> featureClass = getBeanClassLoader().loadClass((String) feature);
            return (WebServiceFeature) BeanUtils.instantiate(featureClass);
        }
        catch (ClassNotFoundException ex) {
            throw new IllegalArgumentException("Could not load WebServiceFeature class [" + feature + "]");
        }
    }
    else {
        throw new IllegalArgumentException("Unknown WebServiceFeature specification type: " + feature.getClass());
    }
}
项目:openjdk-jdk10    文件:MtomFeatureConfigurator.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
/**
 *
 * @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);
        }
    }
}
项目:lams    文件:JaxWsPortClientInterceptor.java   
/**
 * Obtain the port stub from the given JAX-WS Service.
 * @param service the Service object to obtain the port from
 * @param portQName the name of the desired port, if specified
 * @return the corresponding port object as returned from
 * {@code Service.getPort(...)}
 */
protected Object getPortStub(Service service, QName portQName) {
    if (this.portFeatures != null || this.webServiceFeatures != null) {
        WebServiceFeature[] portFeaturesToUse = this.portFeatures;
        if (portFeaturesToUse == null) {
            portFeaturesToUse = new WebServiceFeature[this.webServiceFeatures.length];
            for (int i = 0; i < this.webServiceFeatures.length; i++) {
                portFeaturesToUse[i] = convertWebServiceFeature(this.webServiceFeatures[i]);
            }
        }
        return (portQName != null ? service.getPort(portQName, getServiceInterface(), portFeaturesToUse) :
                service.getPort(getServiceInterface(), portFeaturesToUse));
    }
    else {
        return (portQName != null ? service.getPort(portQName, getServiceInterface()) :
                service.getPort(getServiceInterface()));
    }
}
项目:OpenJSharp    文件:WSEndpointReference.java   
/**
 * Creates a {@link Dispatch} that can be used to talk to this EPR.
 *
 * <p>
 * All the normal WS-Addressing processing happens automatically,
 * such as setting the endpoint address to {@link #getAddress() the address},
 * and sending the reference parameters associated with this EPR as
 * headers, etc.
 */
public @NotNull Dispatch<Object> createDispatch(
    @NotNull Service jaxwsService,
    @NotNull JAXBContext context,
    @NotNull Service.Mode mode,
    WebServiceFeature... features) {

    // TODO: implement it in a better way
    return jaxwsService.createDispatch(toSpec(),context,mode,features);
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
public @Nullable
    <F extends WebServiceFeature> F get(@NotNull Class<F> featureType) {
    WebServiceFeature f = featureType.cast(wsfeatures.get(featureType));
    if (f == null && parent != null) {
        return parent.getFeatures().get(featureType);
    }
    return (F) f;
}
项目:OpenJSharp    文件:WebServiceFeatureList.java   
static public WebServiceFeature[] toFeatureArray(WSBinding binding) {
    //TODO scchen convert BindingID  to WebServiceFeature[]
    if(!binding.isFeatureEnabled(EnvelopeStyleFeature.class)) {
        WebServiceFeature[] f = { binding.getSOAPVersion().toFeature() };
        binding.getFeatures().mergeFeatures(f, false);
    }
    return binding.getFeatures().toArray();
}
项目:openjdk-jdk10    文件:WSEndpointReference.java   
/**
 * Creates a {@link Dispatch} that can be used to talk to this EPR.
 *
 * <p>
 * All the normal WS-Addressing processing happens automatically,
 * such as setting the endpoint address to {@link #getAddress() the address},
 * and sending the reference parameters associated with this EPR as
 * headers, etc.
 */
public @NotNull <T> Dispatch<T> createDispatch(
    @NotNull Service jaxwsService,
    @NotNull Class<T> type,
    @NotNull Service.Mode mode,
    WebServiceFeature... features) {

    // TODO: implement it in a better way
    return jaxwsService.createDispatch(toSpec(),type,mode,features);
}
项目:OpenJSharp    文件:PortInfo.java   
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface,
            BindingImpl existingBinding) {
            if (existingBinding != null) {
                    webServiceFeatures.addAll(existingBinding.getFeatures());
            }

    Iterable<WebServiceFeature> configFeatures;
    //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving
    // ability to turn off the WSDL/Policy based features and its associated tubes.

    //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration
    if (portModel != null) {
        // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap
        // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(),
        // So, using here WsdlModel for merging is right.

        // merge features from WSDL
        configFeatures = portModel.getFeatures();
    } else {
        configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName);
    }
    webServiceFeatures.mergeFeatures(configFeatures, false);

    // merge features from interceptor
    webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false);

    BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray());
    owner.getHandlerConfigurator().configureHandlers(this,bindingImpl);
    return bindingImpl;
}
项目:openjdk-jdk10    文件:ProviderImpl.java   
public ServiceDelegate createServiceDelegate( URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
                                              WebServiceFeature ... features) {
    for (WebServiceFeature feature : features) {
        if (!(feature instanceof ServiceSharedFeatureMarker))
        throw new WebServiceException("Doesn't support any Service specific features");
    }
    return new WSServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass, features);
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
public static @Nullable <F extends WebServiceFeature> F getFeature(@NotNull WebServiceFeature[] features,
                                                                   @NotNull Class<F> featureType) {
    for (WebServiceFeature f : features) {
        if (f.getClass() == featureType)
            return (F) f;
    }
    return null;
}
项目:OpenJSharp    文件:BindingImpl.java   
public void setInputMessageFeatures(@NotNull final QName operationName, WebServiceFeature... newFeatures) {
    if (newFeatures != null) {
        WebServiceFeatureList featureList = inputMessageFeatures.get(operationName);
        if (featureList == null) {
            featureList = new WebServiceFeatureList();
        }
        for (WebServiceFeature f : newFeatures) {
            featureList.add(f);
        }
        inputMessageFeatures.put(operationName, featureList);
    }
}
项目:OpenJSharp    文件:MessageContextFactory.java   
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) {
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        MessageContextFactory newfac = factory.newFactory(f);
        if (newfac != null) return newfac;
    }
    return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f);
}
项目:OpenJSharp    文件:WebServiceFeatureList.java   
public void validate() {
    if (!isValidating) {
        isValidating = true;

        // validation
        for (WebServiceFeature ff : this) {
            validate(ff);
        }
    }
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
public void validate() {
    if (!isValidating) {
        isValidating = true;

        // validation
        for (WebServiceFeature ff : this) {
            validate(ff);
        }
    }
}
项目:openjdk-jdk10    文件:PortInfo.java   
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface,
            BindingImpl existingBinding) {
            if (existingBinding != null) {
                    webServiceFeatures.addAll(existingBinding.getFeatures());
            }

    Iterable<WebServiceFeature> configFeatures;
    //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving
    // ability to turn off the WSDL/Policy based features and its associated tubes.

    //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration
    if (portModel != null) {
        // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap
        // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(),
        // So, using here WsdlModel for merging is right.

        // merge features from WSDL
        configFeatures = portModel.getFeatures();
    } else {
        configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName);
    }
    webServiceFeatures.mergeFeatures(configFeatures, false);

    // merge features from interceptor
    webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false);

    BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray());
    owner.getHandlerConfigurator().configureHandlers(this,bindingImpl);
    return bindingImpl;
}
项目:OpenJSharp    文件:HttpTransportPipe.java   
private static boolean isSticky(WSBinding binding) {
    boolean tSticky = false;
    WebServiceFeature[] features = binding.getFeatures().toArray();
    for(WebServiceFeature f : features) {
        if (f instanceof StickyFeature) {
            tSticky = true;
            break;
        }
    }
    return tSticky;
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
/**
 * Adds a feature to the list if it's not already added.
 */
public void add(@NotNull WebServiceFeature f) {
    if(addNoValidate(f) && isValidating)
        validate(f);
}
项目:rapidminer    文件:RepositoryService_Service.java   
public RepositoryService_Service(WebServiceFeature... features) {
    super(__getWsdlLocation(), REPOSITORYSERVICE_QNAME, features);
}
项目:openjdk-jdk10    文件:DatabindingConfig.java   
public void setFeatures(WebServiceFeature[] features) {
        setFeatures(new WebServiceFeatureList(features));
}
项目:rapidminer    文件:ManagementServiceService.java   
public ManagementServiceService(WebServiceFeature... features) {
    super(__getWsdlLocation(), MANAGEMENTSERVICESERVICE_QNAME, features);
}
项目:rapidminer    文件:ManagementServiceService.java   
public ManagementServiceService(URL wsdlLocation, WebServiceFeature... features) {
    super(wsdlLocation, MANAGEMENTSERVICESERVICE_QNAME, features);
}
项目:rapidminer    文件:ManagementServiceService.java   
public ManagementServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
    super(wsdlLocation, serviceName, features);
}
项目:OpenJSharp    文件:WSServiceDelegate.java   
@Override
public Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features) {
    return createDispatch(portName, wsepr, jaxbContext, mode, new WebServiceFeatureList(features));
}
项目:rapidminer    文件:ProcessService13_Service.java   
public ProcessService13_Service(URL wsdlLocation, WebServiceFeature... features) {
    super(wsdlLocation, PROCESSSERVICE13_QNAME, features);
}
项目:rapidminer    文件:ProcessService13_Service.java   
public ProcessService13_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
    super(wsdlLocation, serviceName, features);
}
项目:openjdk-jdk10    文件:HTTPBindingImpl.java   
HTTPBindingImpl(WebServiceFeature ... features) {
    super(BindingID.XML_HTTP, features);
}
项目:OpenJSharp    文件:FeatureListUtil.java   
public static boolean isFeatureEnabled(@NotNull Class<? extends WebServiceFeature> featureType,
        @Nullable WebServiceFeatureList list1, @Nullable WebServiceFeatureList list2)
        throws WebServiceException {
    final WebServiceFeature mergedFeature = mergeFeature(featureType, list1, list2);
    return (mergedFeature != null) && mergedFeature.isEnabled();
}
项目:OpenJSharp    文件:SOAPBindingCodec.java   
public SOAPBindingCodec(WSFeatureList features, StreamSOAPCodec xmlSoapCodec) {
    super(getSoapVersion(features), features);

    this.xmlSoapCodec = xmlSoapCodec;
    xmlMimeType = xmlSoapCodec.getMimeType();

    xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, features);

    xmlSwaCodec = new SwACodec(version, features, xmlSoapCodec);

    String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
            xmlMtomCodec.getMimeType();

    WebServiceFeature fi = features.get(FastInfosetFeature.class);
    isFastInfosetDisabled = (fi != null && !fi.isEnabled());
    if (!isFastInfosetDisabled) {
        fiSoapCodec = getFICodec(xmlSoapCodec, version);
        if (fiSoapCodec != null) {
            fiMimeType = fiSoapCodec.getMimeType();
            fiSwaCodec = new SwACodec(version, features, fiSoapCodec);
            connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;

            /**
             * This feature will only be present on the client side.
             *
             * Fast Infoset is enabled on the client if the service
             * explicitly supports Fast Infoset.
             */
            WebServiceFeature select = features.get(SelectOptimalEncodingFeature.class);
            if (select != null) { // if the client FI feature is set - ignore negotiation property
                ignoreContentNegotiationProperty = true;
                if (select.isEnabled()) {
                    // If the client's FI encoding feature is enabled, and server's is not disabled
                    if (fi != null) {  // if server's FI feature also enabled
                        useFastInfosetForEncoding = true;
                    }

                    clientAcceptedContentTypes = connegXmlAccept;
                } else {  // If client FI feature is disabled
                    isFastInfosetDisabled = true;
                }
            }
        } else {
            // Fast Infoset could not be loaded by the runtime
            isFastInfosetDisabled = true;
            fiSwaCodec = null;
            fiMimeType = "";
            connegXmlAccept = clientAcceptedContentTypes;
            ignoreContentNegotiationProperty = true;
        }
    } else {
        // Fast Infoset is explicitly not supported by the service
        fiSoapCodec = fiSwaCodec = null;
        fiMimeType = "";
        connegXmlAccept = clientAcceptedContentTypes;
        ignoreContentNegotiationProperty = true;
    }

    xmlAccept = clientAcceptedContentTypes;

    if(getSoapVersion(features) == null)
        throw new WebServiceException("Expecting a SOAP binding but found ");
}
项目:rapidminer    文件:UpdateServiceService.java   
public UpdateServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
    super(wsdlLocation, serviceName, features);
}
项目:module-template    文件:GeoIPService.java   
public GeoIPService(URL wsdlLocation, WebServiceFeature ... features) {
    super(wsdlLocation, SERVICE, features);
}
项目:OpenJSharp    文件:DatabindingFactoryImpl.java   
public Builder feature(WebServiceFeature... f) {
    config.setFeatures(f);
    return this;
}
项目:camel-springboot    文件:GlobalWeather.java   
public GlobalWeather(WebServiceFeature ... features) {
    super(WSDL_LOCATION, SERVICE, features);
}
项目:openjdk-jdk10    文件:WSServiceDelegate.java   
@Override
public Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features) {
    return createDispatch(portName, wsepr, jaxbContext, mode, new WebServiceFeatureList(features));
}
项目:OpenJSharp    文件:MessageContextFactory.java   
protected com.oracle.webservices.internal.api.message.MessageContextFactory newFactory(WebServiceFeature... f) {
    return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f);
}
项目:openjdk-jdk10    文件:BindingImpl.java   
public boolean isOperationFeatureEnabled(@NotNull Class<? extends WebServiceFeature> featureType,
        @NotNull final QName operationName) {
    final WebServiceFeatureList operationFeatureList = this.operationFeatures.get(operationName);
    return FeatureListUtil.isFeatureEnabled(featureType, operationFeatureList, features);
}
项目:KernelHive    文件:MonitoringClientBeanService.java   
public MonitoringClientBeanService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
    super(wsdlLocation, serviceName, features);
}
项目:openjdk-jdk10    文件:SOAPBindingCodec.java   
public SOAPBindingCodec(WSFeatureList features, StreamSOAPCodec xmlSoapCodec) {
    super(getSoapVersion(features), features);

    this.xmlSoapCodec = xmlSoapCodec;
    xmlMimeType = xmlSoapCodec.getMimeType();

    xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, features);

    xmlSwaCodec = new SwACodec(version, features, xmlSoapCodec);

    String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
            xmlMtomCodec.getMimeType();

    WebServiceFeature fi = features.get(FastInfosetFeature.class);
    isFastInfosetDisabled = (fi != null && !fi.isEnabled());
    if (!isFastInfosetDisabled) {
        fiSoapCodec = getFICodec(xmlSoapCodec, version);
        if (fiSoapCodec != null) {
            fiMimeType = fiSoapCodec.getMimeType();
            fiSwaCodec = new SwACodec(version, features, fiSoapCodec);
            connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;

            /**
             * This feature will only be present on the client side.
             *
             * Fast Infoset is enabled on the client if the service
             * explicitly supports Fast Infoset.
             */
            WebServiceFeature select = features.get(SelectOptimalEncodingFeature.class);
            if (select != null) { // if the client FI feature is set - ignore negotiation property
                ignoreContentNegotiationProperty = true;
                if (select.isEnabled()) {
                    // If the client's FI encoding feature is enabled, and server's is not disabled
                    if (fi != null) {  // if server's FI feature also enabled
                        useFastInfosetForEncoding = true;
                    }

                    clientAcceptedContentTypes = connegXmlAccept;
                } else {  // If client FI feature is disabled
                    isFastInfosetDisabled = true;
                }
            }
        } else {
            // Fast Infoset could not be loaded by the runtime
            isFastInfosetDisabled = true;
            fiSwaCodec = null;
            fiMimeType = "";
            connegXmlAccept = clientAcceptedContentTypes;
            ignoreContentNegotiationProperty = true;
        }
    } else {
        // Fast Infoset is explicitly not supported by the service
        fiSoapCodec = fiSwaCodec = null;
        fiMimeType = "";
        connegXmlAccept = clientAcceptedContentTypes;
        ignoreContentNegotiationProperty = true;
    }

    xmlAccept = clientAcceptedContentTypes;

    if(getSoapVersion(features) == null)
        throw new WebServiceException("Expecting a SOAP binding but found ");
}
项目:openjdk-jdk10    文件:WebServiceFeatureList.java   
public boolean isEnabled(@NotNull Class<? extends WebServiceFeature> feature) {
    WebServiceFeature ftr = get(feature);
    return ftr != null && ftr.isEnabled();
}
项目:OpenJSharp    文件:BindingImpl.java   
public @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType){
    return features.get(featureType);
}