本文整理汇总了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());
}
}
示例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;
}
示例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);
}
}
}
示例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()));
}
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例14: validate
import javax.xml.ws.WebServiceFeature; //导入依赖的package包/类
public void validate() {
if (!isValidating) {
isValidating = true;
// validation
for (WebServiceFeature ff : this) {
validate(ff);
}
}
}
示例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;
}