Author: richard.opalka(a)jboss.com
Date: 2010-03-25 05:53:08 -0400 (Thu, 25 Mar 2010)
New Revision: 11857
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
Log:
[JBPAPP-3987] wsprovide have to accept @WebServiceProvider annotated endpoints
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-03-25
09:44:49 UTC (rev 11856)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2010-03-25
09:53:08 UTC (rev 11857)
@@ -32,6 +32,7 @@
import javax.jws.soap.SOAPMessageHandlers;
import javax.management.ObjectName;
import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceProvider;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -286,8 +287,9 @@
private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData,
Class<?> sepClass, String linkName) throws ClassNotFoundException, IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
- if (anWebService == null)
- throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
+ WebServiceProvider anWebServiceProvider =
sepClass.getAnnotation(WebServiceProvider.class);
+ if ((anWebService == null) && (anWebServiceProvider == null))
+ throw new WSException("Cannot obtain neither @WebService nor
@WebServiceProvider annotation from: " + sepClass.getName());
Endpoint ep = dep.getService().getEndpointByName(linkName);
@@ -295,26 +297,26 @@
String seiName;
WSDLUtils wsdlUtils = WSDLUtils.getInstance();
- String name = anWebService.name();
+ String name = (anWebService != null) ? anWebService.name() : "";
if (name.length() == 0)
name = WSDLUtils.getJustClassName(sepClass);
- String serviceName = anWebService.serviceName();
+ String serviceName = (anWebService != null) ? anWebService.serviceName() :
anWebServiceProvider.serviceName();
if (serviceName.length() == 0)
serviceName = WSDLUtils.getJustClassName(sepClass) + "Service";
- String serviceNS = anWebService.targetNamespace();
+ String serviceNS = (anWebService != null) ? anWebService.targetNamespace() :
anWebServiceProvider.targetNamespace();
if (serviceNS.length() == 0)
serviceNS = wsdlUtils.getTypeNamespace(sepClass);
- String portName = anWebService.portName();
+ String portName = (anWebService != null) ? anWebService.portName() :
anWebServiceProvider.portName();
if (portName.length() == 0)
portName = name + "Port";
- String wsdlLocation = anWebService.wsdlLocation();
+ String wsdlLocation = (anWebService != null) ? anWebService.wsdlLocation() :
anWebServiceProvider.wsdlLocation();
String interfaceNS = serviceNS; // the default, but a SEI annotation may override
this
- if (anWebService.endpointInterface().length() > 0)
+ if (anWebService != null && anWebService.endpointInterface().length() >
0)
{
seiName = anWebService.endpointInterface();
ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
Show replies by date