use of javax.xml.ws.WebServiceProvider in project tomee by apache.
the class JaxWsUtils method getName.
public static String getName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
final String sei = webService.endpointInterface();
if (sei != null && sei.trim().length() != 0) {
try {
final Class seiClass = clazz.getClassLoader().loadClass(sei.trim());
return getNameFromInterface(seiClass);
} catch (final ClassNotFoundException e) {
throw new OpenEJBRuntimeException("Unable to load SEI class: " + sei, e);
}
}
return getName(clazz, webService.name());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return clazz.getName();
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
use of javax.xml.ws.WebServiceProvider in project camel by apache.
the class CxfEndpoint method setupServerFactoryBean.
/**
* Populate server factory bean
*/
protected void setupServerFactoryBean(ServerFactoryBean sfb, Class<?> cls) {
// address
sfb.setAddress(getAddress());
sfb.setServiceClass(cls);
sfb.setInInterceptors(in);
sfb.setOutInterceptors(out);
sfb.setOutFaultInterceptors(outFault);
sfb.setInFaultInterceptors(inFault);
sfb.setFeatures(features);
if (schemaLocations != null) {
sfb.setSchemaLocations(schemaLocations);
}
if (bindingConfig != null) {
sfb.setBindingConfig(bindingConfig);
}
if (dataBinding != null) {
sfb.setDataBinding(dataBinding);
}
if (serviceFactoryBean != null) {
setServiceFactory(sfb, serviceFactoryBean);
}
if (sfb instanceof JaxWsServerFactoryBean && handlers != null) {
((JaxWsServerFactoryBean) sfb).setHandlers(handlers);
}
if (getTransportId() != null) {
sfb.setTransportId(getTransportId());
}
if (getBindingId() != null) {
sfb.setBindingId(getBindingId());
}
// wsdl url
if (getWsdlURL() != null) {
sfb.setWsdlURL(getWsdlURL());
}
// service name qname
if (getServiceName() != null) {
sfb.setServiceName(getServiceName());
}
// port qname
if (getPortName() != null) {
sfb.setEndpointName(getPortName());
}
// apply feature here
if (!CxfEndpointUtils.hasAnnotation(cls, WebServiceProvider.class)) {
if (getDataFormat() == DataFormat.PAYLOAD) {
sfb.getFeatures().add(new PayLoadDataFormatFeature(allowStreaming));
} else if (getDataFormat().dealias() == DataFormat.CXF_MESSAGE) {
sfb.getFeatures().add(new CXFMessageDataFormatFeature());
sfb.setDataBinding(new SourceDataBinding());
} else if (getDataFormat().dealias() == DataFormat.RAW) {
RAWDataFormatFeature feature = new RAWDataFormatFeature();
if (this.getExchangePattern().equals(ExchangePattern.InOnly)) {
//if DataFormat is RAW|MESSAGE, can't read message so can't
//determine it's oneway so need get the MEP from URI explicitly
feature.setOneway(true);
}
feature.addInIntercepters(getInInterceptors());
feature.addOutInterceptors(getOutInterceptors());
sfb.getFeatures().add(feature);
}
} else {
LOG.debug("Ignore DataFormat mode {} since SEI class is annotated with WebServiceProvider", getDataFormat());
}
if (isLoggingFeatureEnabled()) {
if (getLoggingSizeLimit() != 0) {
sfb.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
} else {
sfb.getFeatures().add(new LoggingFeature());
}
}
if (getDataFormat() == DataFormat.PAYLOAD) {
sfb.setDataBinding(new HybridSourceDataBinding());
}
// set the document-literal wrapped style
if (getWrappedStyle() != null && getDataFormat().dealias() != DataFormat.CXF_MESSAGE) {
setWrapped(sfb, getWrappedStyle());
}
// any optional properties
if (getProperties() != null) {
if (sfb.getProperties() != null) {
// add to existing properties
sfb.getProperties().putAll(getProperties());
} else {
sfb.setProperties(getProperties());
}
LOG.debug("ServerFactoryBean: {} added properties: {}", sfb, getProperties());
}
if (this.isSkipPayloadMessagePartCheck()) {
if (sfb.getProperties() == null) {
sfb.setProperties(new HashMap<String, Object>());
}
sfb.getProperties().put("soap.no.validate.parts", Boolean.TRUE);
}
if (this.isSkipFaultLogging()) {
if (sfb.getProperties() == null) {
sfb.setProperties(new HashMap<String, Object>());
}
sfb.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
}
sfb.setBus(getBus());
sfb.setStart(false);
getNullSafeCxfEndpointConfigurer().configure(sfb);
}
use of javax.xml.ws.WebServiceProvider in project wildfly by wildfly.
the class WSIntegrationProcessorJAXWS_POJO method exclude.
private boolean exclude(final DeploymentUnit unit, final EEModuleClassDescription classDescription) {
// exclude if it's Enterprise Beans 3 and Jakarta Messaging endpoint
ClassInfo classInfo = null;
ClassAnnotationInformation<WebService, WebServiceAnnotationInfo> annotationInfo = classDescription.getAnnotationInformation(WebService.class);
if (annotationInfo != null) {
classInfo = (ClassInfo) annotationInfo.getClassLevelAnnotations().get(0).getTarget();
} else {
ClassAnnotationInformation<WebServiceProvider, WebServiceProviderAnnotationInfo> providreInfo = classDescription.getAnnotationInformation(WebServiceProvider.class);
classInfo = (ClassInfo) providreInfo.getClassLevelAnnotations().get(0).getTarget();
}
if (isEjb3(classInfo) || isJmsEndpoint(unit, classInfo)) {
return true;
}
return false;
}
use of javax.xml.ws.WebServiceProvider in project tomee by apache.
the class JaxWsUtils method getPortQName.
public static QName getPortQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
use of javax.xml.ws.WebServiceProvider in project tomee by apache.
the class JaxWsUtils method getServiceQName.
public static QName getServiceQName(final Class<?> clazz) {
final WebService webService = clazz.getAnnotation(WebService.class);
if (webService != null) {
return getServiceQName(clazz, webService.targetNamespace(), webService.serviceName());
}
final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
if (webServiceProvider != null) {
return getServiceQName(clazz, webServiceProvider.targetNamespace(), webServiceProvider.serviceName());
}
final WebServiceClient webServiceClient = clazz.getAnnotation(WebServiceClient.class);
if (webServiceClient != null) {
return getServiceQName(clazz, webServiceClient.targetNamespace(), webServiceClient.name());
}
throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}
Aggregations