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()); } }
/** * 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; }
/** * * @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); } } }
/** * 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())); } }
/** * 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); }
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; }
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(); }
/** * 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); }
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; }
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); }
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; }
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); } }
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); }
public void validate() { if (!isValidating) { isValidating = true; // validation for (WebServiceFeature ff : this) { validate(ff); } } }
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; }
/** * Adds a feature to the list if it's not already added. */ public void add(@NotNull WebServiceFeature f) { if(addNoValidate(f) && isValidating) validate(f); }
public RepositoryService_Service(WebServiceFeature... features) { super(__getWsdlLocation(), REPOSITORYSERVICE_QNAME, features); }
public void setFeatures(WebServiceFeature[] features) { setFeatures(new WebServiceFeatureList(features)); }
public ManagementServiceService(WebServiceFeature... features) { super(__getWsdlLocation(), MANAGEMENTSERVICESERVICE_QNAME, features); }
public ManagementServiceService(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, MANAGEMENTSERVICESERVICE_QNAME, features); }
public ManagementServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); }
@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)); }
public ProcessService13_Service(URL wsdlLocation, WebServiceFeature... features) { super(wsdlLocation, PROCESSSERVICE13_QNAME, features); }
public ProcessService13_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); }
HTTPBindingImpl(WebServiceFeature ... features) { super(BindingID.XML_HTTP, features); }
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(); }
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 "); }
public UpdateServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); }
public GeoIPService(URL wsdlLocation, WebServiceFeature ... features) { super(wsdlLocation, SERVICE, features); }
public Builder feature(WebServiceFeature... f) { config.setFeatures(f); return this; }
public GlobalWeather(WebServiceFeature ... features) { super(WSDL_LOCATION, SERVICE, features); }
protected com.oracle.webservices.internal.api.message.MessageContextFactory newFactory(WebServiceFeature... f) { return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f); }
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); }
public MonitoringClientBeanService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { super(wsdlLocation, serviceName, features); }
public boolean isEnabled(@NotNull Class<? extends WebServiceFeature> feature) { WebServiceFeature ftr = get(feature); return ftr != null && ftr.isEnabled(); }
public @Nullable <F extends WebServiceFeature> F getFeature(@NotNull Class<F> featureType){ return features.get(featureType); }