You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/04/26 07:19:33 UTC
svn commit: r532615 [13/13] - in
/webservices/axis2/branches/java/1_2/modules:
jaxws-api/src/javax/xml/ws/handler/soap/ jaxws-api/src/javax/xml/ws/soap/
jaxws/ jaxws/src/org/apache/axis2/jaxws/
jaxws/src/org/apache/axis2/jaxws/binding/ jaxws/src/org/ap...
Modified: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/description/xml/handler/ObjectFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/description/xml/handler/ObjectFactory.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/description/xml/handler/ObjectFactory.java (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/description/xml/handler/ObjectFactory.java Wed Apr 25 22:19:23 2007
@@ -12,333 +12,520 @@
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
-import java.lang.*;
/**
- * This object contains factory methods for each Java content interface and Java element interface
- * generated in the org.apache.axis2.jaxws.description.xml.handler package. <p>An ObjectFactory
- * allows you to programatically construct new instances of the Java representation for XML content.
- * The Java representation of XML content can consist of schema derived interfaces and classes
- * representing the binding of schema type definitions, element declarations and model groups.
- * Factory methods for each of these are provided in this class.
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.apache.axis2.jaxws.description.xml.handler package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
*/
@XmlRegistry
public class ObjectFactory {
- private final static QName _HandlerChains_QNAME =
- new QName("http://java.sun.com/xml/ns/javaee", "handler-chains");
+ private final static QName _HandlerChains_QNAME = new QName("http://java.sun.com/xml/ns/javaee", "handler-chains");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes
- * for package: org.apache.axis2.jaxws.description.xml.handler
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.axis2.jaxws.description.xml.handler
+ *
*/
public ObjectFactory() {
}
- /** Create an instance of {@link EjbRefTypeType } */
- public EjbRefTypeType createEjbRefTypeType() {
- return new EjbRefTypeType();
- }
-
- /** Create an instance of {@link XsdQNameType } */
- public XsdQNameType createXsdQNameType() {
- return new XsdQNameType();
- }
-
- /** Create an instance of {@link PersistenceUnitRefType } */
- public PersistenceUnitRefType createPersistenceUnitRefType() {
- return new PersistenceUnitRefType();
+ /**
+ * Create an instance of {@link PathType }
+ *
+ */
+ public PathType createPathType() {
+ return new PathType();
}
- /** Create an instance of {@link XsdIntegerType } */
- public XsdIntegerType createXsdIntegerType() {
- return new XsdIntegerType();
+ /**
+ * Create an instance of {@link XsdNonNegativeIntegerType }
+ *
+ */
+ public XsdNonNegativeIntegerType createXsdNonNegativeIntegerType() {
+ return new XsdNonNegativeIntegerType();
}
- /** Create an instance of {@link XsdPositiveIntegerType } */
- public XsdPositiveIntegerType createXsdPositiveIntegerType() {
- return new XsdPositiveIntegerType();
+ /**
+ * Create an instance of {@link RemoteType }
+ *
+ */
+ public RemoteType createRemoteType() {
+ return new RemoteType();
}
- /** Create an instance of {@link EnvEntryTypeValuesType } */
- public EnvEntryTypeValuesType createEnvEntryTypeValuesType() {
- return new EnvEntryTypeValuesType();
+ /**
+ * Create an instance of {@link ResSharingScopeType }
+ *
+ */
+ public ResSharingScopeType createResSharingScopeType() {
+ return new ResSharingScopeType();
}
- /** Create an instance of {@link MessageDestinationType } */
- public MessageDestinationType createMessageDestinationType() {
- return new MessageDestinationType();
+ /**
+ * Create an instance of {@link TrueFalseType }
+ *
+ */
+ public TrueFalseType createTrueFalseType() {
+ return new TrueFalseType();
}
- /** Create an instance of {@link JndiNameType } */
- public JndiNameType createJndiNameType() {
- return new JndiNameType();
+ /**
+ * Create an instance of {@link ListenerType }
+ *
+ */
+ public ListenerType createListenerType() {
+ return new ListenerType();
}
- /** Create an instance of {@link EjbRefNameType } */
- public EjbRefNameType createEjbRefNameType() {
- return new EjbRefNameType();
+ /**
+ * Create an instance of {@link XsdIntegerType }
+ *
+ */
+ public XsdIntegerType createXsdIntegerType() {
+ return new XsdIntegerType();
}
- /** Create an instance of {@link IconType } */
- public IconType createIconType() {
- return new IconType();
+ /**
+ * Create an instance of {@link XsdAnyURIType }
+ *
+ */
+ public XsdAnyURIType createXsdAnyURIType() {
+ return new XsdAnyURIType();
}
- /** Create an instance of {@link ResAuthType } */
+ /**
+ * Create an instance of {@link ResAuthType }
+ *
+ */
public ResAuthType createResAuthType() {
return new ResAuthType();
}
- /** Create an instance of {@link ServiceRefHandlerType } */
- public ServiceRefHandlerType createServiceRefHandlerType() {
- return new ServiceRefHandlerType();
+ /**
+ * Create an instance of {@link JavaTypeType }
+ *
+ */
+ public JavaTypeType createJavaTypeType() {
+ return new JavaTypeType();
}
- /** Create an instance of {@link ServiceRefHandlerChainType } */
- public ServiceRefHandlerChainType createServiceRefHandlerChainType() {
- return new ServiceRefHandlerChainType();
+ /**
+ * Create an instance of {@link EjbRefType }
+ *
+ */
+ public EjbRefType createEjbRefType() {
+ return new EjbRefType();
}
- /** Create an instance of {@link java.lang.String } */
- public String createString() {
- return new String();
+ /**
+ * Create an instance of {@link MessageDestinationUsageType }
+ *
+ */
+ public MessageDestinationUsageType createMessageDestinationUsageType() {
+ return new MessageDestinationUsageType();
}
- /** Create an instance of {@link PortComponentRefType } */
- public PortComponentRefType createPortComponentRefType() {
- return new PortComponentRefType();
+ /**
+ * Create an instance of {@link GenericBooleanType }
+ *
+ */
+ public GenericBooleanType createGenericBooleanType() {
+ return new GenericBooleanType();
}
- /** Create an instance of {@link PathType } */
- public PathType createPathType() {
- return new PathType();
+ /**
+ * Create an instance of {@link EjbLinkType }
+ *
+ */
+ public EjbLinkType createEjbLinkType() {
+ return new EjbLinkType();
}
- /** Create an instance of {@link EjbRefType } */
- public EjbRefType createEjbRefType() {
- return new EjbRefType();
+ /**
+ * Create an instance of {@link ServiceRefHandlerChainType }
+ *
+ */
+ public ServiceRefHandlerChainType createServiceRefHandlerChainType() {
+ return new ServiceRefHandlerChainType();
}
- /** Create an instance of {@link InjectionTargetType } */
- public InjectionTargetType createInjectionTargetType() {
- return new InjectionTargetType();
+ /**
+ * Create an instance of {@link FullyQualifiedClassType }
+ *
+ */
+ public FullyQualifiedClassType createFullyQualifiedClassType() {
+ return new FullyQualifiedClassType();
}
- /** Create an instance of {@link GenericBooleanType } */
- public GenericBooleanType createGenericBooleanType() {
- return new GenericBooleanType();
+ /**
+ * Create an instance of {@link HandlerChainsType }
+ *
+ */
+ public HandlerChainsType createHandlerChainsType() {
+ return new HandlerChainsType();
}
- /** Create an instance of {@link HandlerType } */
+ /**
+ * Create an instance of {@link HandlerType }
+ *
+ */
public HandlerType createHandlerType() {
return new HandlerType();
}
- /** Create an instance of {@link ParamValueType } */
- public ParamValueType createParamValueType() {
- return new ParamValueType();
- }
-
- /** Create an instance of {@link DisplayNameType } */
- public DisplayNameType createDisplayNameType() {
- return new DisplayNameType();
+ /**
+ * Create an instance of {@link DescriptionType }
+ *
+ */
+ public DescriptionType createDescriptionType() {
+ return new DescriptionType();
}
- /** Create an instance of {@link FullyQualifiedClassType } */
- public FullyQualifiedClassType createFullyQualifiedClassType() {
- return new FullyQualifiedClassType();
+ /**
+ * Create an instance of {@link XsdStringType }
+ *
+ */
+ public XsdStringType createXsdStringType() {
+ return new XsdStringType();
}
- /** Create an instance of {@link HomeType } */
- public HomeType createHomeType() {
- return new HomeType();
+ /**
+ * Create an instance of {@link String }
+ *
+ */
+ public String createString() {
+ return new String();
}
- /** Create an instance of {@link EmptyType } */
+ /**
+ * Create an instance of {@link EmptyType }
+ *
+ */
public EmptyType createEmptyType() {
return new EmptyType();
}
- /** Create an instance of {@link MessageDestinationTypeType } */
- public MessageDestinationTypeType createMessageDestinationTypeType() {
- return new MessageDestinationTypeType();
+ /**
+ * Create an instance of {@link EjbRefTypeType }
+ *
+ */
+ public EjbRefTypeType createEjbRefTypeType() {
+ return new EjbRefTypeType();
}
- /** Create an instance of {@link XsdNMTOKENType } */
- public XsdNMTOKENType createXsdNMTOKENType() {
- return new XsdNMTOKENType();
+ /**
+ * Create an instance of {@link XsdPositiveIntegerType }
+ *
+ */
+ public XsdPositiveIntegerType createXsdPositiveIntegerType() {
+ return new XsdPositiveIntegerType();
}
- /** Create an instance of {@link ResourceEnvRefType } */
- public ResourceEnvRefType createResourceEnvRefType() {
- return new ResourceEnvRefType();
+ /**
+ * Create an instance of {@link DisplayNameType }
+ *
+ */
+ public DisplayNameType createDisplayNameType() {
+ return new DisplayNameType();
}
- /** Create an instance of {@link EjbLocalRefType } */
- public EjbLocalRefType createEjbLocalRefType() {
- return new EjbLocalRefType();
+ /**
+ * Create an instance of {@link IconType }
+ *
+ */
+ public IconType createIconType() {
+ return new IconType();
}
- /** Create an instance of {@link ListenerType } */
- public ListenerType createListenerType() {
- return new ListenerType();
+ /**
+ * Create an instance of {@link JndiNameType }
+ *
+ */
+ public JndiNameType createJndiNameType() {
+ return new JndiNameType();
}
- /** Create an instance of {@link LocalType } */
- public LocalType createLocalType() {
- return new LocalType();
+ /**
+ * Create an instance of {@link MessageDestinationRefType }
+ *
+ */
+ public MessageDestinationRefType createMessageDestinationRefType() {
+ return new MessageDestinationRefType();
}
- /** Create an instance of {@link RemoteType } */
- public RemoteType createRemoteType() {
- return new RemoteType();
+ /**
+ * Create an instance of {@link EjbLocalRefType }
+ *
+ */
+ public EjbLocalRefType createEjbLocalRefType() {
+ return new EjbLocalRefType();
}
- /** Create an instance of {@link XsdBooleanType } */
- public XsdBooleanType createXsdBooleanType() {
- return new XsdBooleanType();
+ /**
+ * Create an instance of {@link SecurityRoleType }
+ *
+ */
+ public SecurityRoleType createSecurityRoleType() {
+ return new SecurityRoleType();
}
- /** Create an instance of {@link ResourceRefType } */
- public ResourceRefType createResourceRefType() {
- return new ResourceRefType();
+ /**
+ * Create an instance of {@link PersistenceUnitRefType }
+ *
+ */
+ public PersistenceUnitRefType createPersistenceUnitRefType() {
+ return new PersistenceUnitRefType();
}
- /** Create an instance of {@link HandlerChainType } */
+ /**
+ * Create an instance of {@link SecurityRoleRefType }
+ *
+ */
+ public SecurityRoleRefType createSecurityRoleRefType() {
+ return new SecurityRoleRefType();
+ }
+
+ /**
+ * Create an instance of {@link HandlerChainType }
+ *
+ */
public HandlerChainType createHandlerChainType() {
return new HandlerChainType();
}
- /** Create an instance of {@link PropertyType } */
- public PropertyType createPropertyType() {
- return new PropertyType();
+ /**
+ * Create an instance of {@link RoleNameType }
+ *
+ */
+ public RoleNameType createRoleNameType() {
+ return new RoleNameType();
}
- /** Create an instance of {@link ServiceRefHandlerChainsType } */
- public ServiceRefHandlerChainsType createServiceRefHandlerChainsType() {
- return new ServiceRefHandlerChainsType();
+ /**
+ * Create an instance of {@link MessageDestinationTypeType }
+ *
+ */
+ public MessageDestinationTypeType createMessageDestinationTypeType() {
+ return new MessageDestinationTypeType();
}
- /** Create an instance of {@link RunAsType } */
- public RunAsType createRunAsType() {
- return new RunAsType();
+ /**
+ * Create an instance of {@link XsdNMTOKENType }
+ *
+ */
+ public XsdNMTOKENType createXsdNMTOKENType() {
+ return new XsdNMTOKENType();
}
- /** Create an instance of {@link RoleNameType } */
- public RoleNameType createRoleNameType() {
- return new RoleNameType();
+ /**
+ * Create an instance of {@link JavaIdentifierType }
+ *
+ */
+ public JavaIdentifierType createJavaIdentifierType() {
+ return new JavaIdentifierType();
}
- /** Create an instance of {@link TrueFalseType } */
- public TrueFalseType createTrueFalseType() {
- return new TrueFalseType();
+ /**
+ * Create an instance of {@link ResourceEnvRefType }
+ *
+ */
+ public ResourceEnvRefType createResourceEnvRefType() {
+ return new ResourceEnvRefType();
}
- /** Create an instance of {@link XsdAnyURIType } */
- public XsdAnyURIType createXsdAnyURIType() {
- return new XsdAnyURIType();
+ /**
+ * Create an instance of {@link PortComponentRefType }
+ *
+ */
+ public PortComponentRefType createPortComponentRefType() {
+ return new PortComponentRefType();
}
- /** Create an instance of {@link SecurityRoleType } */
- public SecurityRoleType createSecurityRoleType() {
- return new SecurityRoleType();
+ /**
+ * Create an instance of {@link InjectionTargetType }
+ *
+ */
+ public InjectionTargetType createInjectionTargetType() {
+ return new InjectionTargetType();
}
- /** Create an instance of {@link MessageDestinationLinkType } */
- public MessageDestinationLinkType createMessageDestinationLinkType() {
- return new MessageDestinationLinkType();
+ /**
+ * Create an instance of {@link PersistenceContextTypeType }
+ *
+ */
+ public PersistenceContextTypeType createPersistenceContextTypeType() {
+ return new PersistenceContextTypeType();
}
- /** Create an instance of {@link XsdStringType } */
- public XsdStringType createXsdStringType() {
- return new XsdStringType();
+ /**
+ * Create an instance of {@link ParamValueType }
+ *
+ */
+ public ParamValueType createParamValueType() {
+ return new ParamValueType();
}
- /** Create an instance of {@link ServiceRefType } */
- public ServiceRefType createServiceRefType() {
- return new ServiceRefType();
+ /**
+ * Create an instance of {@link ServiceRefHandlerType }
+ *
+ */
+ public ServiceRefHandlerType createServiceRefHandlerType() {
+ return new ServiceRefHandlerType();
}
- /** Create an instance of {@link PersistenceContextRefType } */
- public PersistenceContextRefType createPersistenceContextRefType() {
- return new PersistenceContextRefType();
+ /**
+ * Create an instance of {@link LifecycleCallbackType }
+ *
+ */
+ public LifecycleCallbackType createLifecycleCallbackType() {
+ return new LifecycleCallbackType();
}
- /** Create an instance of {@link XsdNonNegativeIntegerType } */
- public XsdNonNegativeIntegerType createXsdNonNegativeIntegerType() {
- return new XsdNonNegativeIntegerType();
+ /**
+ * Create an instance of {@link ServiceRefType }
+ *
+ */
+ public ServiceRefType createServiceRefType() {
+ return new ServiceRefType();
}
- /** Create an instance of {@link LocalHomeType } */
- public LocalHomeType createLocalHomeType() {
- return new LocalHomeType();
+ /**
+ * Create an instance of {@link MessageDestinationLinkType }
+ *
+ */
+ public MessageDestinationLinkType createMessageDestinationLinkType() {
+ return new MessageDestinationLinkType();
}
- /** Create an instance of {@link PersistenceContextTypeType } */
- public PersistenceContextTypeType createPersistenceContextTypeType() {
- return new PersistenceContextTypeType();
+ /**
+ * Create an instance of {@link MessageDestinationType }
+ *
+ */
+ public MessageDestinationType createMessageDestinationType() {
+ return new MessageDestinationType();
}
- /** Create an instance of {@link UrlPatternType } */
+ /**
+ * Create an instance of {@link UrlPatternType }
+ *
+ */
public UrlPatternType createUrlPatternType() {
return new UrlPatternType();
}
- /** Create an instance of {@link EnvEntryType } */
- public EnvEntryType createEnvEntryType() {
- return new EnvEntryType();
+ /**
+ * Create an instance of {@link HomeType }
+ *
+ */
+ public HomeType createHomeType() {
+ return new HomeType();
}
- /** Create an instance of {@link MessageDestinationUsageType } */
- public MessageDestinationUsageType createMessageDestinationUsageType() {
- return new MessageDestinationUsageType();
+ /**
+ * Create an instance of {@link ResourceRefType }
+ *
+ */
+ public ResourceRefType createResourceRefType() {
+ return new ResourceRefType();
}
- /** Create an instance of {@link JavaIdentifierType } */
- public JavaIdentifierType createJavaIdentifierType() {
- return new JavaIdentifierType();
+ /**
+ * Create an instance of {@link EnvEntryTypeValuesType }
+ *
+ */
+ public EnvEntryTypeValuesType createEnvEntryTypeValuesType() {
+ return new EnvEntryTypeValuesType();
}
- /** Create an instance of {@link HandlerChainsType } */
- public HandlerChainsType createHandlerChainsType() {
- return new HandlerChainsType();
+ /**
+ * Create an instance of {@link EjbRefNameType }
+ *
+ */
+ public EjbRefNameType createEjbRefNameType() {
+ return new EjbRefNameType();
}
- /** Create an instance of {@link MessageDestinationRefType } */
- public MessageDestinationRefType createMessageDestinationRefType() {
- return new MessageDestinationRefType();
+ /**
+ * Create an instance of {@link RunAsType }
+ *
+ */
+ public RunAsType createRunAsType() {
+ return new RunAsType();
}
- /** Create an instance of {@link EjbLinkType } */
- public EjbLinkType createEjbLinkType() {
- return new EjbLinkType();
+ /**
+ * Create an instance of {@link LocalType }
+ *
+ */
+ public LocalType createLocalType() {
+ return new LocalType();
}
- /** Create an instance of {@link SecurityRoleRefType } */
- public SecurityRoleRefType createSecurityRoleRefType() {
- return new SecurityRoleRefType();
+ /**
+ * Create an instance of {@link PropertyType }
+ *
+ */
+ public PropertyType createPropertyType() {
+ return new PropertyType();
}
- /** Create an instance of {@link ResSharingScopeType } */
- public ResSharingScopeType createResSharingScopeType() {
- return new ResSharingScopeType();
+ /**
+ * Create an instance of {@link ServiceRefHandlerChainsType }
+ *
+ */
+ public ServiceRefHandlerChainsType createServiceRefHandlerChainsType() {
+ return new ServiceRefHandlerChainsType();
}
- /** Create an instance of {@link DescriptionType } */
- public DescriptionType createDescriptionType() {
- return new DescriptionType();
+ /**
+ * Create an instance of {@link LocalHomeType }
+ *
+ */
+ public LocalHomeType createLocalHomeType() {
+ return new LocalHomeType();
}
- /** Create an instance of {@link LifecycleCallbackType } */
- public LifecycleCallbackType createLifecycleCallbackType() {
- return new LifecycleCallbackType();
+ /**
+ * Create an instance of {@link XsdBooleanType }
+ *
+ */
+ public XsdBooleanType createXsdBooleanType() {
+ return new XsdBooleanType();
}
- /** Create an instance of {@link JavaTypeType } */
- public JavaTypeType createJavaTypeType() {
- return new JavaTypeType();
+ /**
+ * Create an instance of {@link XsdQNameType }
+ *
+ */
+ public XsdQNameType createXsdQNameType() {
+ return new XsdQNameType();
+ }
+
+ /**
+ * Create an instance of {@link EnvEntryType }
+ *
+ */
+ public EnvEntryType createEnvEntryType() {
+ return new EnvEntryType();
+ }
+
+ /**
+ * Create an instance of {@link PersistenceContextRefType }
+ *
+ */
+ public PersistenceContextRefType createPersistenceContextRefType() {
+ return new PersistenceContextRefType();
}
/**
@@ -347,8 +534,7 @@
*/
@XmlElementDecl(namespace = "http://java.sun.com/xml/ns/javaee", name = "handler-chains")
public JAXBElement<HandlerChainsType> createHandlerChains(HandlerChainsType value) {
- return new JAXBElement<HandlerChainsType>(_HandlerChains_QNAME, HandlerChainsType.class,
- null, value);
+ return new JAXBElement<HandlerChainsType>(_HandlerChains_QNAME, HandlerChainsType.class, null, value);
}
}
Modified: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Wed Apr 25 22:19:23 2007
@@ -36,8 +36,7 @@
createDispatchFail2=Dispatch creation failed. The service cannot find Port data for the {0} port.
addPortDup=An attempt was made to add the {0} port to the ServiceDelegate. The port already exists.
addPortErr0=Only the SOAP11HTTP_BINDING, SOAP12HTTP_BINDING, SOAP11HTTP_MTOM_BINDING, SOAP12HTTP_MTOM_BINDING and HTTP_BINDING ports are supported at this time. The {0} port cannot be added to the ServiceDelegate.
-# The key addPortErr1 is not currently used
-# addPortErr1=An attempt was made to add the {0} port with the {1} endpoint address, which is not valid, to the ServiceDelegate. This addition is not allowed.
+addPortErr1=An attempt was made to add the {0} port with the {1} endpoint address, which is not valid, to the ServiceDelegate. This addition is not allowed.
addPortErr2=An attempt was made to add a port without a name to the ServiceDelegate object. This addition is not allowed.
serviceDelegateConstruct0=An attempt was made to construct the ServiceDelegate object with an service name that is not valid: {0}.
serviceDelegateConstruct1=An attempt was made to construct the ServiceDelegate object with the {0} service, but the service is not defined in the {1} WSDL file.
@@ -129,6 +128,7 @@
JAXBBlockFactoryErr1=An internal assertion error occurred. The context parameter of the JAXBBlockFactory.createFrom method should be a JAXBBlockContext object, but a {0} object was found.
JAXBBlockFactoryErr2=An internal assertion error occurred. The business object parameter of JAXBBlockFactory.createFrom method should be a JAXBElement object or an object with an @XmlRootElement annotation, but a {0} object was found.
JAXBBlockFactoryErr3=An internal assertion error occurred. The qName parameter of JAXBBlockFactory.createFrom method should not be null.
+WSDL4JWrapperErr1=Unable to read wsdl from relative path.
WebServiceContextInjectionImplErr1=A null service instance cannot be injected into the resource.
WebServiceContextInjectionImplErr2=The injection of private and protected set methods are not supported.
WebServiceContextInjectionImplErr3=A null service instance cannot be injected into the webservices context.
@@ -153,8 +153,10 @@
NullParamErr1=Argument {0} in operation {1} is null. This is not allowed for messages {2}.
unknownHost=The host specified by the URL is unknown.
connectionRefused=An attempt to connect to the URL was refused.
+urlStream=The WSDL file could not be located.
mimeBodyPartError=Error: Problem creating mime parts.
schemaImportError=An internal error occurred resolving imported schema {0} relative to parent document {1}
ExecutorShutdown=RejectedExcecutionException. The request is rejected because the Executor Service for the service is shutdown.
handlerChainNS=The @HandlerChain configuration file {0} in the class {1} could not be loaded.
hcConfigLoadFail=The @HandlerChain configuration file {0} in the class {1} could not be loaded due to the following error: {2}
+serverSideAsync=The server-side SEI {0} contains the asynchronous method {1}. Asynchronous methods are not allowed for server-side artifacts.
Modified: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java Wed Apr 25 22:19:23 2007
@@ -19,6 +19,10 @@
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.metadata.factory.ResourceFinderFactory;
+import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
+import org.apache.axis2.metadata.resource.ResourceFinder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -35,12 +39,15 @@
import javax.xml.namespace.QName;
import java.io.File;
import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
import java.net.ConnectException;
+import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLConnection;
import java.net.UnknownHostException;
+import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
@@ -58,15 +65,30 @@
private URL wsdlURL;
public WSDL4JWrapper(URL wsdlURL) throws FileNotFoundException, UnknownHostException,
- ConnectException, WSDLException {
+ ConnectException, IOException, WSDLException {
super();
+ if(log.isDebugEnabled()) {
+ log.debug("Looking for wsdl file on client: " + (wsdlURL != null ?
+ wsdlURL.getPath():null));
+ }
+ ClassLoader classLoader = (ClassLoader) AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
this.wsdlURL = wsdlURL;
try {
URL url = wsdlURL;
+ String filePath = null;
boolean isFileProtocol =
(url != null && "file".equals(url.getProtocol())) ? true : false;
if (isFileProtocol) {
- String filePath = (url != null) ? url.getPath() : null;
+ filePath = (url != null) ? url.getPath() : null;
+ URI uri = null;
+ if(url != null) {
+ uri = url.toURI();
+ }
//Check is the uri has relative path i.e path is not absolute and is not starting with a "/"
boolean isRelativePath =
(filePath != null && !new File(filePath).isAbsolute()) ? true : false;
@@ -74,19 +96,9 @@
if (log.isDebugEnabled()) {
log.debug("WSDL URL has a relative path");
}
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
//Lets read the complete WSDL URL for relative path from class loader
//Use relative path of url to fetch complete URL.
- url = loader.getResource(filePath);
- if (url == null) {
- //Let see if we can get this resource from a jar file. This code is only relevant in case of a
- //thin client scenario where client has chose to put wsdl inside a jar and provided a relative
- //path.
- if (loader instanceof URLClassLoader) {
- URLClassLoader urlLoader = (URLClassLoader)loader;
- url = getURLFromJAR(urlLoader, wsdlURL);
- }
- }
+ url = getAbsoluteURL(classLoader, filePath);
if (url == null) {
if (log.isDebugEnabled()) {
log.debug("WSDL URL for relative path not found in ClassLoader");
@@ -98,12 +110,51 @@
}
url = wsdlURL;
}
+ else {
+ if(log.isDebugEnabled()) {
+ log.debug("WSDL URL found for relative path: " + filePath + " scheme: " +
+ uri.getScheme());
+ }
+ }
}
}
URLConnection urlCon = url.openConnection();
- InputStream is = urlCon.getInputStream();
- is.close();
+ InputStream is = null;
+ try {
+ is = urlCon.getInputStream();
+ }
+ catch(IOException e) {
+ if(log.isDebugEnabled()) {
+ log.debug("Could not open url connection. Trying to use " +
+ "classloader to get another URL.");
+ }
+ if(filePath != null) {
+ url = getAbsoluteURL(classLoader, filePath);
+ if(url == null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Could not locate URL for wsdl. Reporting error");
+ }
+ throw new WSDLException("WSDL4JWrapper : ", e.getMessage(), e);
+ }
+ else {
+ urlCon = url.openConnection();
+ if(log.isDebugEnabled()) {
+ log.debug("Found URL for WSDL from jar");
+ }
+ }
+ }
+ else {
+ if(log.isDebugEnabled()) {
+ log.debug("Could not get URL from classloader. Reporting " +
+ "error due to no file path.");
+ }
+ throw new WSDLException("WSDL4JWrapper : ", e.getMessage(), e);
+ }
+ }
+ if(is != null) {
+ is.close();
+ }
final String explicitWsdl = urlCon.getURL().toString();
try {
wsdlDefinition = (Definition)AccessController.doPrivileged(
@@ -127,15 +178,38 @@
throw ex;
} catch (ConnectException ex) {
throw ex;
+ } catch(IOException ex) {
+ throw ex;
} catch (Exception ex) {
throw new WSDLException("WSDL4JWrapper : ", ex.getMessage());
}
}
-
+ private URL getAbsoluteURL(ClassLoader classLoader, String filePath){
+ URL url = classLoader.getResource(filePath);
+ if(url == null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Could not get URL from classloader. Looking in a jar.");
+ }
+ if(classLoader instanceof URLClassLoader){
+ URLClassLoader urlLoader = (URLClassLoader)classLoader;
+ url = getURLFromJAR(urlLoader, wsdlURL);
+ }
+ }
+ return url;
+ }
private URL getURLFromJAR(URLClassLoader urlLoader, URL relativeURL) {
- URL[] urlList = urlLoader.getURLs();
+ URL[] urlList = null;
+ ResourceFinderFactory rff =(ResourceFinderFactory)MetadataFactoryRegistry.getFactory(ResourceFinderFactory.class);
+ ResourceFinder cf = rff.getResourceFinder();
+ urlList = cf.getURLs(urlLoader);
+ if(urlList == null){
+ if(log.isDebugEnabled()){
+ log.debug("No URL's found in URL ClassLoader");
+ }
+ ExceptionFactory.makeWebServiceException(Messages.getMessage("WSDL4JWrapperErr1"));
+ }
for (URL url : urlList) {
if ("file".equals(url.getProtocol())) {
@@ -154,8 +228,17 @@
if (name.endsWith(".wsdl")) {
String relativePath = relativeURL.getPath();
if (relativePath.endsWith(name)) {
+ String path = f.getAbsolutePath();
+ // This check is necessary because Unix/Linux file paths begin
+ // with a '/'. When adding the prefix 'jar:file:/' we may end
+ // up with '//' after the 'file:' part. This causes the URL
+ // object to treat this like a remote resource
+ if(path != null && path.indexOf("/") == 0) {
+ path = path.substring(1, path.length());
+ }
+
URL absoluteUrl = new URL("jar:file:/"
- + f.getAbsolutePath() + "!/"
+ + path + "!/"
+ je.getName());
return absoluteUrl;
}
Added: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/factory/ResourceFinderFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/factory/ResourceFinderFactory.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/factory/ResourceFinderFactory.java (added)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/factory/ResourceFinderFactory.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.metadata.factory;
+
+import org.apache.axis2.metadata.resource.ResourceFinder;
+import org.apache.axis2.metadata.resource.impl.ResourceFinderImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ResourceFinderFactory {
+
+ private static final Log log = LogFactory.getLog(ResourceFinderFactory.class);
+
+ private ResourceFinder finder = null;
+
+ public ResourceFinder getResourceFinder() {
+ if (finder != null) {
+ return finder;
+ }
+ return new ResourceFinderImpl();
+ }
+
+ public void setResourceFinder(ResourceFinder finder) {
+ if(this.finder == null) {
+ this.finder = finder;
+ }
+ }
+
+}
Added: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java (added)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.metadata.registry;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.apache.axis2.metadata.factory.ResourceFinderFactory;
+
+public class MetadataFactoryRegistry {
+ private final static Map<Class,Object> table;
+ static {
+ table = new Hashtable<Class,Object>();
+ table.put(ResourceFinderFactory.class, new ResourceFinderFactory());
+ }
+
+ /**
+ * FactoryRegistry is currently a static singleton
+ */
+ private MetadataFactoryRegistry() {
+ }
+
+ /**
+ * getFactory
+ * @param intface of the Factory
+ * @return Object that is the factory implementation for the intface
+ */
+ public static Object getFactory(Class intface) {
+ return table.get(intface);
+ }
+
+ /**
+ * setFactory
+ * @param intface
+ * @param factoryObject
+ */
+ public static void setFactory(Class intface, Object factoryObject){
+ table.put(intface, factoryObject);
+ }
+
+}
Added: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/ResourceFinder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/ResourceFinder.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/ResourceFinder.java (added)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/ResourceFinder.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.metadata.resource;
+
+import java.net.URL;
+
+/*
+ * ResourceFinder will be used to find Resources from a classloader.
+ * for example a ResourceFinder can be used to get all the resources as url from classloader
+ * or it can be used to find a class in classpath from Classloader.
+ */
+
+public interface ResourceFinder {
+
+ /**
+ * This method reads all the resource URLs available to this classLoader.
+ * @param cl
+ * @return
+ */
+ URL[] getURLs(ClassLoader cl);
+
+}
Added: webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/impl/ResourceFinderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/impl/ResourceFinderImpl.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/impl/ResourceFinderImpl.java (added)
+++ webservices/axis2/branches/java/1_2/modules/metadata/src/org/apache/axis2/metadata/resource/impl/ResourceFinderImpl.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.metadata.resource.impl;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.apache.axis2.metadata.resource.ResourceFinder;
+
+
+public class ResourceFinderImpl implements ResourceFinder {
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.metadata.resource.ResourceFinder#getURLs(java.lang.ClassLoader)
+ */
+ public URL[] getURLs(ClassLoader cl) {
+ if(cl instanceof URLClassLoader){
+ URLClassLoader urlLoader = (URLClassLoader)cl;
+ return urlLoader.getURLs();
+ }
+ return null;
+ }
+
+}
Modified: webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationProviderImplDescriptionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationProviderImplDescriptionTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationProviderImplDescriptionTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationProviderImplDescriptionTests.java Wed Apr 25 22:19:23 2007
@@ -128,8 +128,7 @@
public void testNoWebServiceProvider() {
// Use the description factory directly; this will be done within the JAX-WS runtime
try {
- ServiceDescription serviceDesc =
- DescriptionFactory.createServiceDescription(NoWebServiceProviderTestImpl.class);
+ DescriptionFactory.createServiceDescription(NoWebServiceProviderTestImpl.class);
fail("Expected WebServiceException not caught");
}
catch (WebServiceException e) {
@@ -144,9 +143,7 @@
public void testBothWebServiceAnnotations() {
// Use the description factory directly; this will be done within the JAX-WS runtime
try {
- ServiceDescription serviceDesc =
- DescriptionFactory
- .createServiceDescription(BothWebServiceAnnotationTestImpl.class);
+ DescriptionFactory.createServiceDescription(BothWebServiceAnnotationTestImpl.class);
fail("Expected WebServiceException not caught");
}
catch (WebServiceException e) {
Modified: webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java Wed Apr 25 22:19:23 2007
@@ -42,7 +42,7 @@
static public URL getWSDLURL(String wsdlFileName) {
URL wsdlURL = null;
// Get the URL to the WSDL file. Note that 'basedir' is setup by Maven
- String basedir = System.getProperty("basedir");
+ String basedir = System.getProperty("basedir", ".");
String urlString = "file://localhost/" + basedir + "/test-resources/wsdl/" + wsdlFileName;
try {
wsdlURL = new URL(urlString);
Modified: webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java?view=diff&rev=532615&r1=532614&r2=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java (original)
+++ webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitBareResolveOperationTests.java Wed Apr 25 22:19:23 2007
@@ -221,14 +221,14 @@
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op1(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op1param1PartName") int param1) {
+ name = "op1param1PartName") int param1) {
}
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op2(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op2param1PartName",
+ name = "op2param1PartName",
mode = WebParam.Mode.INOUT) Holder<Integer> param1) {
}
@@ -236,10 +236,10 @@
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op3(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op3param1PartName",
+ name = "op3param1PartName",
mode = WebParam.Mode.INOUT) Holder<Integer> param1,
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op3param2PartName",
+ name = "op3param2PartName",
mode = WebParam.Mode.IN) int param2) {
}
@@ -247,7 +247,7 @@
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op4(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op4param1PartName",
+ name = "op4param1PartName",
mode = WebParam.Mode.OUT) Holder<Integer> param1) {
}
@@ -255,10 +255,10 @@
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op5(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op5param1PartName",
+ name = "op5param1PartName",
mode = WebParam.Mode.OUT) Holder<Integer> param1,
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op5param2PartName",
+ name = "op5param2PartName",
mode = WebParam.Mode.IN) int param2) {
}
@@ -277,11 +277,11 @@
parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void op8(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op8param1PartName",
+ name = "op8param1PartName",
mode = WebParam.Mode.IN,
header = true) Integer param1,
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op8param2PartName",
+ name = "op8param2PartName",
mode = WebParam.Mode.IN) int param2) {
}
@@ -289,7 +289,7 @@
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public void op10(
@WebParam(targetNamespace = "org.apache.axis2.jaxws.description.DLBResolveOperation",
- partName = "op10param1PartName") int param1) {
+ name = "op10param1PartName") int param1) {
}
}
Added: webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/ValidateServiceImplTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/ValidateServiceImplTests.java?view=auto&rev=532615
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/ValidateServiceImplTests.java (added)
+++ webservices/axis2/branches/java/1_2/modules/metadata/test/org/apache/axis2/jaxws/description/ValidateServiceImplTests.java Wed Apr 25 22:19:23 2007
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.description;
+
+import java.util.HashMap;
+import java.util.List;
+
+import javax.jws.WebService;
+
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter;
+
+import junit.framework.TestCase;
+
+/**
+ *
+ */
+public class ValidateServiceImplTests extends TestCase {
+
+ public void testValidServiceImpl() {
+ try {
+ Class serviceImplClass = ServiceImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ assertNotNull(serviceDescList);
+ assertEquals(1, serviceDescList.size());
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ fail("Caught unexpected exception" + e);
+ }
+ }
+
+ public void testMissingMethods() {
+ try {
+ Class serviceImplClass = MissingMethodsImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+ public void testInvalidThrows() {
+ try {
+ Class serviceImplClass = InvalidThrowsImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+ public void testMismatchedReturnTypesDBC() {
+ try {
+ Class serviceImplClass = ServiceImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ // Set the return types for one of the methods on the impl class to mismatch the SEI
+ DescriptionBuilderComposite implDBC = dbcMap.get("org.apache.axis2.jaxws.description.ServiceImpl");
+ assertNotNull(implDBC);
+ List<MethodDescriptionComposite> m1MDCList = implDBC.getMethodDescriptionComposite("method1");
+ assertNotNull(m1MDCList);
+ assertEquals(1, m1MDCList.size());
+ MethodDescriptionComposite m1MDC = m1MDCList.get(0);
+ assertEquals("java.lang.String", m1MDC.getReturnType());
+ m1MDC.setReturnType("lava.lang.Integer");
+
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+ public void testMismatchedReturnTypes() {
+ try {
+ Class serviceImplClass = MismatchedReturnTypesImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+ public void testMismatchedParameterNumber() {
+ try {
+ Class serviceImplClass = MismatchedParameterNumberImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+ public void testMismatchedParameterTypes() {
+ try {
+ Class serviceImplClass = MismatchedParameterTypesImpl.class;
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(serviceImplClass);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+ fail("Should have caused exception");
+ }
+ catch (Exception e) {
+ // Expected path
+ }
+ }
+
+}
+
+@WebService
+interface EndpointInterface {
+ public String method1(int param1, int param2) throws MyException;
+
+ public void method2(String param1) throws MyException;
+
+ public int method3();
+}
+
+class MyException extends Exception {
+
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class ServiceImpl {
+ public String method1(int param1, int param2) throws MyException {
+ return null;
+ }
+
+ // Intentionally doesn't throw MyException. It is valid for a service impl to throw
+ // fewer exceptions than the endpoint interface
+ public void method2(String param1) {
+
+ }
+
+ public int method3() {
+ return 0;
+ }
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class MissingMethodsImpl {
+ public String method1(int param1, int param2) {
+ return null;
+ }
+
+// public void method2(String param1) {
+//
+// }
+
+ public int method3() {
+ return 0;
+ }
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class InvalidThrowsImpl {
+ public String method1(int param1, int param2) throws MyException {
+ return null;
+ }
+
+ // Intentionally doesn't throw MyException. It is valid for a service impl to throw
+ // fewer exceptions than the endpoint interface
+ public void method2(String param1) {
+
+ }
+ // It is invalid to throw more exceptions than the endpoint interface
+ public int method3() throws MyException {
+ return 0;
+ }
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class MismatchedReturnTypesImpl {
+ // Return type doesn't match SEI
+ public Integer method1(int param1, int param2) throws MyException {
+ return null;
+ }
+
+ public void method2(String param1) {
+
+ }
+
+ public int method3() {
+ return 0;
+ }
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class MismatchedParameterNumberImpl {
+ public String method1(int param1) throws MyException {
+ return null;
+ }
+
+ public void method2(String param1) {
+
+ }
+
+ public int method3() {
+ return 0;
+ }
+}
+
+@WebService (endpointInterface = "org.apache.axis2.jaxws.description.EndpointInterface")
+class MismatchedParameterTypesImpl {
+ public String method1(int param1, String param2) throws MyException {
+ return null;
+ }
+
+ // Intentionally doesn't throw MyException. It is valid for a service impl to throw
+ // fewer exceptions than the endpoint interface
+ public void method2(String param1) {
+
+ }
+
+ public int method3() {
+ return 0;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org