當前位置: 首頁>>代碼示例>>Java>>正文


Java WebServiceFeature類代碼示例

本文整理匯總了Java中javax.xml.ws.WebServiceFeature的典型用法代碼示例。如果您正苦於以下問題:Java WebServiceFeature類的具體用法?Java WebServiceFeature怎麽用?Java WebServiceFeature使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WebServiceFeature類屬於javax.xml.ws包,在下文中一共展示了WebServiceFeature類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertWebServiceFeature

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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());
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:AbstractJaxWsServiceExporter.java

示例2: getFeatures

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:29,代碼來源:MtomFeatureConfigurator.java

示例3: parseAnnotations

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
/**
 *
 * @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);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:22,代碼來源:WebServiceFeatureList.java

示例4: getPortStub

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
/**
 * 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()));
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:25,代碼來源:JaxWsPortClientInterceptor.java

示例5: createDispatch

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:19,代碼來源:WSEndpointReference.java

示例6: get

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:WebServiceFeatureList.java

示例7: toFeatureArray

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:WebServiceFeatureList.java

示例8: createDispatch

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:19,代碼來源:WSEndpointReference.java

示例9: createBinding

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:31,代碼來源:PortInfo.java

示例10: createServiceDelegate

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:ProviderImpl.java

示例11: getFeature

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:WebServiceFeatureList.java

示例12: setInputMessageFeatures

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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);
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:BindingImpl.java

示例13: createFactory

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:8,代碼來源:MessageContextFactory.java

示例14: validate

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
public void validate() {
    if (!isValidating) {
        isValidating = true;

        // validation
        for (WebServiceFeature ff : this) {
            validate(ff);
        }
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:11,代碼來源:WebServiceFeatureList.java

示例15: isSticky

import javax.xml.ws.WebServiceFeature; //導入依賴的package包/類
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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:12,代碼來源:HttpTransportPipe.java


注:本文中的javax.xml.ws.WebServiceFeature類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。