Author: djencks Date: Sun Feb 20 20:43:02 2005 New Revision: 154623 URL: http://svn.apache.org/viewcvs?view=rev&rev=154623 Log: Put the pieces in place for POJO WS deployment. Refactor non-axis specific ws dd manipulation into a separate class.
Added: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/PortInfo.java geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyAxisPOJOWebService.java Removed: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/ServiceReference.java Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml geronimo/trunk/modules/axis-builder/project.xml geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java geronimo/trunk/modules/j2ee-schema/maven.xml geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java geronimo/trunk/modules/jetty-builder/project.xml geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml (original) +++ geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml Sun Feb 20 20:43:02 2005 @@ -124,10 +124,12 @@ <attribute name="defaultWelcomeFiles">index.html,index.htm,index.jsp</attribute> <attribute name="jettyContainerObjectName">geronimo.server:name=JettyWebContainer,*</attribute> <attribute name="defaultServlets">geronimo.server:j2eeType=DefaultServlet,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</attribute> + <attribute name="pojoWebServiceTemplate">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=ServletWebServiceTemplate,name=AxisPOJOTemplate</attribute> + <reference name="WebServiceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference> <reference name="Repository">*:name=Repository,*</reference> </gbean> - <gbean name="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Deployer,J2EEServer=geronimo,j2eeType=DefaultServlet,name=StaticContent" class="org.apache.geronimo.jetty.JettyServletHolder"> + <gbean namePart="StaticContent" class="org.apache.geronimo.jetty.JettyServletHolder"> <attribute name="servletName">default</attribute> <attribute name="servletClass">org.mortbay.jetty.servlet.Default</attribute> <attribute name="loadOnStartup">0</attribute> @@ -141,7 +143,7 @@ <attribute name="servletMappings">/</attribute> </gbean> - <gbean name="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Deployer,J2EEServer=geronimo,j2eeType=DefaultServlet,name=JSPServlet" class="org.apache.geronimo.jetty.JettyServletHolder"> + <gbean namePart="JSPServlet" class="org.apache.geronimo.jetty.JettyServletHolder"> <attribute name="servletName">jsp</attribute> <attribute name="servletClass">org.apache.jasper.servlet.JspServlet</attribute> <attribute name="loadOnStartup">0</attribute> @@ -150,6 +152,11 @@ fork=false xpoweredBy=false</attribute> <attribute name="servletMappings">*.jsp,*.jspf,*.jspx,*.xsp</attribute> + </gbean> + + <gbean namePart="AxisPOJOTemplate" class="org.apache.geronimo.jetty.JettyAxisPOJOWebService"> + <attribute name="servletName">dummy</attribute> + </gbean> <gbean namePart="EJBBuilder" class="org.openejb.deployment.OpenEJBModuleBuilder"> Modified: geronimo/trunk/modules/axis-builder/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/project.xml?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/axis-builder/project.xml (original) +++ geronimo/trunk/modules/axis-builder/project.xml Sun Feb 20 20:43:02 2005 @@ -65,6 +65,24 @@ <!-- Module Dependencies --> <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-jaxrpc</artifactId> + <version>${geronimo_spec_jaxrpc_version}</version> + </dependency> + + <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-saaj</artifactId> + <version>${geronimo_spec_saaj_version}</version> + </dependency> + + <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-qname</artifactId> + <version>${geronimo_spec_qname_version}</version> + </dependency> + + <dependency> <groupId>geronimo</groupId> <artifactId>geronimo-axis</artifactId> <version>${pom.currentVersion}</version> @@ -197,12 +215,6 @@ <dependency> <groupId>axis</groupId> - <artifactId>axis-jaxrpc</artifactId> - <version>${axis_jaxrpc_version}</version> - </dependency> - - <dependency> - <groupId>axis</groupId> <artifactId>axis</artifactId> <version>${axis_version}</version> </dependency> @@ -212,11 +224,7 @@ <artifactId>commons-discovery</artifactId> <version>${axis_commons_discovery_version}</version> </dependency> - <dependency> - <groupId>axis</groupId> - <artifactId>axis-saaj</artifactId> - <version>${axis_saaj_version}</version> - </dependency> + <dependency> <groupId>axis</groupId> <artifactId>axis-wsdl4j</artifactId> Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java Sun Feb 20 20:43:02 2005 @@ -18,18 +18,14 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.ObjectOutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.math.BigDecimal; -import java.math.BigInteger; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; -import java.util.Calendar; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -47,41 +43,12 @@ import javax.wsdl.Part; import javax.wsdl.Port; import javax.wsdl.PortType; -import javax.wsdl.Types; -import javax.wsdl.WSDLException; -import javax.wsdl.extensions.ExtensibilityElement; -import javax.wsdl.extensions.UnknownExtensibilityElement; -import javax.wsdl.extensions.schema.Schema; import javax.wsdl.extensions.soap.SOAPAddress; import javax.wsdl.extensions.soap.SOAPBinding; import javax.wsdl.extensions.soap.SOAPBody; import javax.wsdl.extensions.soap.SOAPOperation; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLLocator; -import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; import javax.xml.rpc.handler.HandlerInfo; -import javax.xml.rpc.holders.BigDecimalHolder; -import javax.xml.rpc.holders.BigIntegerHolder; -import javax.xml.rpc.holders.BooleanHolder; -import javax.xml.rpc.holders.BooleanWrapperHolder; -import javax.xml.rpc.holders.ByteArrayHolder; -import javax.xml.rpc.holders.ByteHolder; -import javax.xml.rpc.holders.ByteWrapperHolder; -import javax.xml.rpc.holders.CalendarHolder; -import javax.xml.rpc.holders.DoubleHolder; -import javax.xml.rpc.holders.DoubleWrapperHolder; -import javax.xml.rpc.holders.FloatHolder; -import javax.xml.rpc.holders.FloatWrapperHolder; -import javax.xml.rpc.holders.IntHolder; -import javax.xml.rpc.holders.IntegerWrapperHolder; -import javax.xml.rpc.holders.LongHolder; -import javax.xml.rpc.holders.LongWrapperHolder; -import javax.xml.rpc.holders.ObjectHolder; -import javax.xml.rpc.holders.QNameHolder; -import javax.xml.rpc.holders.ShortHolder; -import javax.xml.rpc.holders.ShortWrapperHolder; -import javax.xml.rpc.holders.StringHolder; import net.sf.cglib.core.DefaultGeneratorStrategy; import net.sf.cglib.proxy.Callback; @@ -109,101 +76,61 @@ import org.apache.geronimo.axis.client.SerializableNoOp; import org.apache.geronimo.axis.client.ServiceImpl; import org.apache.geronimo.axis.client.ServiceMethodInterceptor; -import org.apache.geronimo.axis.client.ServiceReference; import org.apache.geronimo.axis.client.TypeMappingInfo; import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.deployment.DeploymentContext; +import org.apache.geronimo.gbean.GBeanData; import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.j2ee.deployment.Module; import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder; +import org.apache.geronimo.j2ee.deployment.WebServiceBuilder; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; import org.apache.geronimo.kernel.ClassLoading; import org.apache.geronimo.naming.reference.DeserializingReference; -import org.apache.geronimo.schema.SchemaConversionUtils; import org.apache.geronimo.xbeans.j2ee.ConstructorParameterOrderType; import org.apache.geronimo.xbeans.j2ee.ExceptionMappingType; -import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument; import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType; import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType; import org.apache.geronimo.xbeans.j2ee.MethodParamPartsMappingType; -import org.apache.geronimo.xbeans.j2ee.PackageMappingType; import org.apache.geronimo.xbeans.j2ee.ServiceEndpointInterfaceMappingType; import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType; import org.apache.geronimo.xbeans.j2ee.WsdlMessageMappingType; import org.apache.geronimo.xbeans.j2ee.WsdlReturnValueMappingType; -import org.apache.xmlbeans.XmlCursor; -import org.apache.xmlbeans.XmlException; -import org.apache.xmlbeans.XmlObject; import org.objectweb.asm.Type; import org.w3.x2001.xmlSchema.ComplexType; import org.w3.x2001.xmlSchema.ExplicitGroup; import org.w3.x2001.xmlSchema.LocalElement; -import org.w3.x2001.xmlSchema.SchemaDocument; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; /** * @version $Rev: $ $Date: $ */ -public class AxisBuilder implements ServiceReferenceBuilder { +public class AxisBuilder implements ServiceReferenceBuilder, WebServiceBuilder { private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new Class[]{Map.class, Map.class}; - private static final URI ENHANCED_LOCATION = URI.create("cglib/"); private static final SOAPConstants SOAP_VERSION = SOAPConstants.SOAP11_CONSTANTS; - public ServiceReference createServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, DeploymentContext deploymentContext, ClassLoader classLoader) throws DeploymentException { - Enhancer enhancer = new Enhancer(); - enhancer.setClassLoader(classLoader); - enhancer.setSuperclass(ServiceImpl.class); - enhancer.setInterfaces(new Class[]{serviceInterface}); - enhancer.setCallbackFilter(new NoOverrideCallbackFilter(Service.class)); - enhancer.setCallbackTypes(new Class[]{NoOp.class, MethodInterceptor.class}); - enhancer.setUseFactory(false); - ByteArrayRetrievingGeneratorStrategy strategy = new ByteArrayRetrievingGeneratorStrategy(); - enhancer.setStrategy(strategy); - Class enhanced = enhancer.createClass(); + //WebServiceBuilder + public void configurePOJO(GBeanData targetGBean, Object portInfoObject, String seiClassName) throws DeploymentException { + PortInfo portInfo = (PortInfo)portInfoObject; + System.out.println("NOT CONFIGURING WEB SERVICE " + portInfo.getPortName()); + } + + public void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName) throws DeploymentException { - saveClass(deploymentContext, enhanced.getName(), strategy.getClassBytes()); - return new ServiceReference(enhanced, null, null, null); } + + //ServicereferenceBuilder public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException { JarFile moduleFile = module.getModuleFile(); Definition definition = null; JavaWsdlMappingType mapping = null; if (wsdlURI != null) { - JarWSDLLocator wsdlLocator = new JarWSDLLocator(moduleFile, wsdlURI); - WSDLFactory wsdlFactory = null; - try { - wsdlFactory = WSDLFactory.newInstance(); - } catch (WSDLException e) { - throw new DeploymentException("Could not create WSDLFactory", e); - } - WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); - definition = null; - try { - definition = wsdlReader.readWSDL(wsdlLocator); - } catch (WSDLException e) { - throw new DeploymentException("Failed to read wsdl document", e); - } + definition = WSDescriptorParser.readWsdl(moduleFile, wsdlURI); - InputStream jaxrpcInputStream = null; - try { - jaxrpcInputStream = moduleFile.getInputStream(moduleFile.getEntry(jaxrpcMappingURI.toString())); - } catch (IOException e) { - throw new DeploymentException("Could not open stream to jaxrpc mapping document", e); - } - JavaWsdlMappingDocument mappingDocument = null; - try { - mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcInputStream); - } catch (XmlException e) { - throw new DeploymentException("Could not parse jaxrpc mapping document", e); - } catch (IOException e) { - throw new DeploymentException("Could not read jaxrpc mapping document", e); - } - mapping = mappingDocument.getJavaWsdlMapping(); + mapping = WSDescriptorParser.readJaxrpcMapping(moduleFile, jaxrpcMappingURI); } Object service = createService(serviceInterface, definition, mapping, serviceQName, SOAP_VERSION, handlerInfos, deploymentContext, module, classLoader); @@ -282,15 +209,15 @@ Map wsdlPortMap = service.getPorts(); - Map complexTypeMap = getComplexTypesInWsdl(definition); - Map exceptionMap = getExceptionMap(mapping); + Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(definition); + Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping); for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String portName = (String) entry.getKey(); Port port = (Port) entry.getValue(); - SOAPAddress soapAddress = (SOAPAddress) getExtensibilityElement(SOAPAddress.class, port.getExtensibilityElements()); + SOAPAddress soapAddress = (SOAPAddress) WSDescriptorParser.getExtensibilityElement(SOAPAddress.class, port.getExtensibilityElements()); String locationURIString = soapAddress.getLocationURI(); URL location = null; try { @@ -300,7 +227,7 @@ } Binding binding = port.getBinding(); - SOAPBinding soapBinding = (SOAPBinding) getExtensibilityElement(SOAPBinding.class, binding.getExtensibilityElements()); + SOAPBinding soapBinding = (SOAPBinding) WSDescriptorParser.getExtensibilityElement(SOAPBinding.class, binding.getExtensibilityElements()); // String transportURI = soapBinding.getTransportURI(); String portStyleString = soapBinding.getStyle(); Style portStyle = Style.getStyle(portStyleString); @@ -332,7 +259,7 @@ } else { //complete jaxrpc mapping file supplied QName portTypeQName = portType.getQName(); - ServiceEndpointInterfaceMappingType endpointMapping = getServiceEndpointInterfaceMapping(endpointMappings, portTypeQName); + ServiceEndpointInterfaceMappingType endpointMapping = WSDescriptorParser.getServiceEndpointInterfaceMapping(endpointMappings, portTypeQName); String fqcn = endpointMapping.getServiceEndpointInterface().getStringValue(); try { serviceEndpointInterface = classLoader.loadClass(fqcn); @@ -345,8 +272,9 @@ int i = 0; for (Iterator ops = operations.iterator(); ops.hasNext();) { Operation operation = (Operation) ops.next(); - BindingOperation bindingOperation = binding.getBindingOperation(operation.getName(), operation.getInput().getName(), operation.getOutput() == null ? null : operation.getOutput().getName()); - ServiceEndpointMethodMappingType methodMapping = getMethodMappingForOperation(operation, methodMappings); + String operationName = operation.getName(); + BindingOperation bindingOperation = binding.getBindingOperation(operationName, operation.getInput().getName(), operation.getOutput() == null ? null : operation.getOutput().getName()); + ServiceEndpointMethodMappingType methodMapping = WSDescriptorParser.getMethodMappingForOperation(operationName, methodMappings); OperationInfo operationInfo = buildOperationInfoHeavyweight(methodMapping, bindingOperation, portStyle, soapVersion, exceptionMap, complexTypeMap, mapping, classLoader); operationInfos[i++] = operationInfo; } @@ -396,30 +324,6 @@ } } - private Map getExceptionMap(JavaWsdlMappingType mapping) { - Map exceptionMap = new HashMap(); - if (mapping != null) { - ExceptionMappingType[] exceptionMappings = mapping.getExceptionMappingArray(); - for (int i = 0; i < exceptionMappings.length; i++) { - ExceptionMappingType exceptionMapping = exceptionMappings[i]; - QName exceptionMessageQName = exceptionMapping.getWsdlMessage().getQNameValue(); - exceptionMap.put(exceptionMessageQName, exceptionMapping); - } - } - return exceptionMap; - } - - private ServiceEndpointMethodMappingType getMethodMappingForOperation(Operation operation, ServiceEndpointMethodMappingType[] methodMappings) throws DeploymentException { - String operationName = operation.getName(); - for (int i = 0; i < methodMappings.length; i++) { - ServiceEndpointMethodMappingType methodMapping = methodMappings[i]; - if (operationName.equals(methodMapping.getWsdlOperation().getStringValue())) { - return methodMapping; - } - } - throw new DeploymentException("No method found for operation named " + operationName); - } - private Method getMethodForOperation(Class enhancedServiceEndpointClass, Operation operation) throws DeploymentException { Method[] methods = enhancedServiceEndpointClass.getMethods(); String opName = operation.getName(); @@ -442,7 +346,7 @@ private Class getServiceEndpointInterfaceLightweight(PortType portType, JavaWsdlMappingType mappings, ClassLoader classLoader) throws DeploymentException { QName portTypeQName = portType.getQName(); String portTypeNamespace = portTypeQName.getNamespaceURI(); - String portTypePackage = getPackageFromNamespace(portTypeNamespace, mappings); + String portTypePackage = WSDescriptorParser.getPackageFromNamespace(portTypeNamespace, mappings); StringBuffer shortInterfaceName = new StringBuffer(portTypeQName.getLocalPart()); shortInterfaceName.setCharAt(0, Character.toUpperCase(shortInterfaceName.charAt(0))); //TODO just use one buffer! @@ -455,37 +359,6 @@ } - private ServiceEndpointInterfaceMappingType getServiceEndpointInterfaceMapping(ServiceEndpointInterfaceMappingType[] endpointMappings, QName portTypeQName) throws DeploymentException { - for (int i = 0; i < endpointMappings.length; i++) { - ServiceEndpointInterfaceMappingType endpointMapping = endpointMappings[i]; - QName testPortQName = endpointMapping.getWsdlPortType().getQNameValue(); - if (portTypeQName.equals(testPortQName)) { - return endpointMapping; - } - } - throw new DeploymentException("Could not find service endpoint interface for port named " + portTypeQName); - } - - private ExtensibilityElement getExtensibilityElement(Class clazz, List extensibilityElements) throws DeploymentException { - for (Iterator iterator = extensibilityElements.iterator(); iterator.hasNext();) { - ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); - if (clazz.isAssignableFrom(extensibilityElement.getClass())) { - return extensibilityElement; - } - } - throw new DeploymentException("No element of class " + clazz.getName() + " found"); - } - - private String getPackageFromNamespace(String namespace, JavaWsdlMappingType mapping) throws DeploymentException { - PackageMappingType[] packageMappings = mapping.getPackageMappingArray(); - for (int i = 0; i < packageMappings.length; i++) { - PackageMappingType packageMapping = packageMappings[i]; - if (namespace.equals(packageMapping.getNamespaceURI().getStringValue().trim())) { - return packageMapping.getPackageType().getStringValue().trim(); - } - } - throw new DeploymentException("Namespace " + namespace + " was not mapped in jaxrpc mapping file"); - } public SEIFactory createSEIFactory(String portName, Class enhancedServiceEndpointClass, Object serviceImpl, List typeMappings, URL location, OperationInfo[] operationInfos, List handlerInfoInfos, DeploymentContext deploymentContext, ClassLoader classLoader) throws DeploymentException { List handlerInfos = buildHandlerInfosForPort(portName, handlerInfoInfos); @@ -583,12 +456,12 @@ Class returnClass = method.getReturnType(); operationDesc.setReturnClass(returnClass); - SOAPOperation soapOperation = (SOAPOperation) getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); + SOAPOperation soapOperation = (SOAPOperation) WSDescriptorParser.getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); String soapActionURI = soapOperation.getSoapActionURI(); String styleString = soapOperation.getStyle(); Style style = Style.getStyle(styleString, defaultStyle); BindingInput bindingInput = bindingOperation.getBindingInput(); - SOAPBody soapBody = (SOAPBody) getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements()); + SOAPBody soapBody = (SOAPBody) WSDescriptorParser.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements()); String useString = soapBody.getUse(); Use use = Use.getUse(useString); operationDesc.setStyle(style); @@ -700,7 +573,8 @@ //use complexTypeMap boolean isComplexType = complexTypeMap.containsKey(partTypeQName); String paramJavaTypeName = paramMapping.getParamType().getStringValue().trim(); - Class actualParamJavaType = getHolderType(paramJavaTypeName, mode, partTypeQName, isComplexType, mapping, classLoader); + boolean isInOnly = mode == ParameterDesc.IN; + Class actualParamJavaType = WSDescriptorParser.getHolderType(paramJavaTypeName, isInOnly, partTypeQName, isComplexType, mapping, classLoader); ParameterDesc parameterDesc = new ParameterDesc(partQName, mode, partTypeQName, actualParamJavaType, inHeader, outHeader); parameterDescriptions[position] = parameterDesc; @@ -771,12 +645,12 @@ operationDesc.setReturnType(returnType); operationDesc.setReturnClass(returnClass); - SOAPOperation soapOperation = (SOAPOperation) getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); + SOAPOperation soapOperation = (SOAPOperation) WSDescriptorParser.getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); String soapActionURI = soapOperation.getSoapActionURI(); String styleString = soapOperation.getStyle(); Style style = Style.getStyle(styleString, defaultStyle); BindingInput bindingInput = bindingOperation.getBindingInput(); - SOAPBody soapBody = (SOAPBody) getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements()); + SOAPBody soapBody = (SOAPBody) WSDescriptorParser.getExtensibilityElement(SOAPBody.class, bindingInput.getExtensibilityElements()); String useString = soapBody.getUse(); Use use = Use.getUse(useString); operationDesc.setStyle(style); @@ -831,7 +705,7 @@ QName elementType = (QName) elementMap.get(elementName); String javaElementTypeName; if (complexTypeMap.containsKey(elementType)) { - String packageName = getPackageFromNamespace(elementType.getNamespaceURI(), mapping); + String packageName = WSDescriptorParser.getPackageFromNamespace(elementType.getNamespaceURI(), mapping); javaElementTypeName = packageName + "." + elementType.getLocalPart(); } else { //TODO finish this @@ -866,188 +740,6 @@ return operationInfo; } - /** - * Find all the top level complex types in the schemas in the definitions' types. - * Put them in a map from complex type QName to schema fragment. - * TODO it is not clear what happens with included schemas. - * - * @param definition - * @return - * @throws DeploymentException - */ - Map getComplexTypesInWsdl(Definition definition) throws DeploymentException { - Map complexTypeMap = new HashMap(); - Types types = definition.getTypes(); - Map namespaceMap = definition.getNamespaces(); - if (types != null) { - List schemas = types.getExtensibilityElements(); - for (Iterator iterator = schemas.iterator(); iterator.hasNext();) { - Object o = iterator.next(); - if (o instanceof Schema) { - Schema unknownExtensibilityElement = (Schema) o; - QName elementType = unknownExtensibilityElement.getElementType(); - if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { - Element element = unknownExtensibilityElement.getElement(); - try { - XmlObject xmlObject = SchemaConversionUtils.parse(element); - XmlCursor cursor = xmlObject.newCursor(); - try { - cursor.toFirstContentToken(); - for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) { - Map.Entry entry = (Map.Entry) namespaces.next(); - cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue()); - } - } finally { - cursor.dispose(); - } - SchemaDocument schemaDoc = (SchemaDocument) xmlObject.changeType(SchemaDocument.type); - SchemaConversionUtils.validateDD(schemaDoc); - SchemaDocument.Schema schema = schemaDoc.getSchema(); - String targetNamespace = schema.getTargetNamespace(); - ComplexType[] complexTypes = schema.getComplexTypeArray(); - for (int j = 0; j < complexTypes.length; j++) { - ComplexType complexType = complexTypes[j]; - String complexTypeName = complexType.getName(); - QName complexTypeQName = new QName(targetNamespace, complexTypeName); - complexTypeMap.put(complexTypeQName, complexType); - } - } catch (XmlException e) { - throw new DeploymentException("Invalid schema in wsdl", e); - } - } else { - //problems?? - } - } else if (o instanceof UnknownExtensibilityElement) { - //This is apparently obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above. - //I'm leaving this in in case this Schema class is not really part of a spec, even though its in javax. - UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o; - QName elementType = unknownExtensibilityElement.getElementType(); - if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { - Element element = unknownExtensibilityElement.getElement(); - try { - XmlObject xmlObject = SchemaConversionUtils.parse(element); - XmlCursor cursor = xmlObject.newCursor(); - try { - cursor.toFirstContentToken(); - for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) { - Map.Entry entry = (Map.Entry) namespaces.next(); - cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue()); - } - } finally { - cursor.dispose(); - } - SchemaDocument schemaDoc = (SchemaDocument) xmlObject.changeType(SchemaDocument.type); - SchemaConversionUtils.validateDD(schemaDoc); - SchemaDocument.Schema schema = schemaDoc.getSchema(); - String targetNamespace = schema.getTargetNamespace(); - ComplexType[] complexTypes = schema.getComplexTypeArray(); - for (int j = 0; j < complexTypes.length; j++) { - ComplexType complexType = complexTypes[j]; - String complexTypeName = complexType.getName(); - QName complexTypeQName = new QName(targetNamespace, complexTypeName); - complexTypeMap.put(complexTypeQName, complexType); - } - } catch (XmlException e) { - throw new DeploymentException("Invalid schema in wsdl", e); - } - } else { - //problems?? - } - } - } - } - return complexTypeMap; - } - - private static final Map rpcHolderClasses = new HashMap(); - - static { - rpcHolderClasses.put(BigDecimal.class, BigDecimalHolder.class); - rpcHolderClasses.put(BigInteger.class, BigIntegerHolder.class); - rpcHolderClasses.put(boolean.class, BooleanHolder.class); - rpcHolderClasses.put(Boolean.class, BooleanWrapperHolder.class); - rpcHolderClasses.put(byte[].class, ByteArrayHolder.class); - rpcHolderClasses.put(byte.class, ByteHolder.class); - rpcHolderClasses.put(Byte.class, ByteWrapperHolder.class); - rpcHolderClasses.put(Calendar.class, CalendarHolder.class); - rpcHolderClasses.put(double.class, DoubleHolder.class); - rpcHolderClasses.put(Double.class, DoubleWrapperHolder.class); - rpcHolderClasses.put(float.class, FloatHolder.class); - rpcHolderClasses.put(Float.class, FloatWrapperHolder.class); - rpcHolderClasses.put(int.class, IntHolder.class); - rpcHolderClasses.put(Integer.class, IntegerWrapperHolder.class); - rpcHolderClasses.put(long.class, LongHolder.class); - rpcHolderClasses.put(Long.class, LongWrapperHolder.class); - rpcHolderClasses.put(Object.class, ObjectHolder.class); - rpcHolderClasses.put(QName.class, QNameHolder.class); - rpcHolderClasses.put(short.class, ShortHolder.class); - rpcHolderClasses.put(Short.class, ShortWrapperHolder.class); - rpcHolderClasses.put(String.class, StringHolder.class); - } - - private Class getHolderType(String paramJavaTypeName, byte mode, QName typeQName, boolean isComplexType, JavaWsdlMappingType mapping, ClassLoader classLoader) throws DeploymentException { - Class paramJavaType = null; - if (mode == ParameterDesc.IN) { - //IN parameters just use their own type - try { - paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader); - } catch (ClassNotFoundException e) { - throw new DeploymentException("could not load parameter type", e); - } - return paramJavaType; - } else { - //INOUT and OUT parameters use holders. See jaxrpc spec 4.3.5 - String holderName; - if (isComplexType) { - //complex types get mapped: - //package is determined from the namespace to package map + ".holders" - //class name is the complex type QNMAne local part + "Holder", with the initial character uppercased. - String namespace = typeQName.getNamespaceURI(); - String packageName = getPackageFromNamespace(namespace, mapping); - StringBuffer buf = new StringBuffer(packageName.length() + typeQName.getLocalPart().length() + 14); - buf.append(packageName).append(".holders.").append(typeQName.getLocalPart()).append("Holder"); - buf.setCharAt(packageName.length() + 9, Character.toUpperCase(typeQName.getLocalPart().charAt(0))); - holderName = buf.toString(); - } else { - //see if it is in the primitive type and simple type mapping - try { - paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader); - } catch (ClassNotFoundException e) { - throw new DeploymentException("could not load parameter type", e); - } - Class holder = (Class) rpcHolderClasses.get(paramJavaType); - if (holder != null) { - return holder; - } - //Otherwise, the holder must be in: - //package same as type's package + ".holders" - //class name same as type name + "Holder" - String paramTypeName = paramJavaType.getName(); - StringBuffer buf = new StringBuffer(paramTypeName.length() + 14); - int dot = paramTypeName.lastIndexOf("."); - //foo.Bar >>> foo.holders.BarHolder - buf.append(paramTypeName.substring(0, dot)).append(".holders").append(paramTypeName.substring(dot)).append("Holder"); - holderName = buf.toString(); - } - try { - Class holder = ClassLoading.loadClass(holderName, classLoader); - return holder; - } catch (ClassNotFoundException e) { - throw new DeploymentException("Could not load holder class", e); - } - } - } - - - private void saveClass(DeploymentContext deploymentContext, String className, byte[] classBytes) throws DeploymentException { - try { - deploymentContext.addClass(ENHANCED_LOCATION, className, classBytes, true); - } catch (IOException e) { - throw new DeploymentException("Could not save enhanced class bytes", e); - } catch (URISyntaxException e) { - throw new DeploymentException("Could not construct URI for class file", e); - } - } private static class ByteArrayRetrievingGeneratorStrategy extends DefaultGeneratorStrategy { @@ -1063,53 +755,13 @@ } } - static class JarWSDLLocator implements WSDLLocator { - - private final JarFile moduleFile; - private final URI wsdlURI; - private URI latestImportURI; - - public JarWSDLLocator(JarFile moduleFile, URI wsdlURI) { - this.moduleFile = moduleFile; - this.wsdlURI = wsdlURI; - } - - public InputSource getBaseInputSource() { - InputStream wsdlInputStream = null; - try { - wsdlInputStream = moduleFile.getInputStream(moduleFile.getEntry(wsdlURI.toString())); - } catch (IOException e) { - throw new RuntimeException("Could not open stream to wsdl file", e); - } - return new InputSource(wsdlInputStream); - } - - public String getBaseURI() { - return wsdlURI.toString(); - } - - public InputSource getImportInputSource(String parentLocation, String relativeLocation) { - URI parentURI = URI.create(parentLocation); - latestImportURI = parentURI.resolve(relativeLocation); - InputStream importInputStream = null; - try { - importInputStream = moduleFile.getInputStream(moduleFile.getEntry(latestImportURI.toString())); - } catch (IOException e) { - throw new RuntimeException("Could not open stream to import file", e); - } - return new InputSource(importInputStream); - } - - public String getLatestImportURI() { - return latestImportURI.toString(); - } - } public static final GBeanInfo GBEAN_INFO; static { GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(AxisBuilder.class, NameFactory.MODULE_BUILDER); infoBuilder.addInterface(ServiceReferenceBuilder.class); + infoBuilder.addInterface(WebServiceBuilder.class); GBEAN_INFO = infoBuilder.getBeanInfo(); } Added: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/PortInfo.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/PortInfo.java?view=auto&rev=154623 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/PortInfo.java (added) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/PortInfo.java Sun Feb 20 20:43:02 2005 @@ -0,0 +1,68 @@ +/** + * + * Copyright 2003-2004 The Apache Software Foundation + * + * 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.geronimo.axis.builder; + +import javax.xml.namespace.QName; +import javax.wsdl.Definition; + +import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType; +import org.apache.geronimo.xbeans.j2ee.PortComponentHandlerType; + +/** + * @version $Rev: $ $Date: $ + */ +public class PortInfo { + private final String portName; + private final QName portQName; + private final Definition definition; + private final JavaWsdlMappingType javaWsdlMapping; + private final String seiInterfaceName; + private final PortComponentHandlerType[] handlers; + + public PortInfo(String portName, QName portQName, Definition definition, JavaWsdlMappingType javaWsdlMapping, String seiInterfaceName, PortComponentHandlerType[] handlers) { + this.portName = portName; + this.portQName = portQName; + this.definition = definition; + this.javaWsdlMapping = javaWsdlMapping; + this.seiInterfaceName = seiInterfaceName; + this.handlers = handlers; + } + + public String getPortName() { + return portName; + } + + public QName getPortQName() { + return portQName; + } + + public Definition getDefinition() { + return definition; + } + + public JavaWsdlMappingType getJavaWsdlMapping() { + return javaWsdlMapping; + } + + public String getSeiInterfaceName() { + return seiInterfaceName; + } + + public PortComponentHandlerType[] getHandlers() { + return handlers; + } +} Added: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?view=auto&rev=154623 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java (added) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java Sun Feb 20 20:43:02 2005 @@ -0,0 +1,457 @@ +/** + * + * Copyright 2003-2004 The Apache Software Foundation + * + * 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.geronimo.axis.builder; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.jar.JarFile; +import javax.wsdl.Definition; +import javax.wsdl.Types; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.UnknownExtensibilityElement; +import javax.wsdl.extensions.schema.Schema; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLLocator; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; +import javax.xml.rpc.holders.BigDecimalHolder; +import javax.xml.rpc.holders.BigIntegerHolder; +import javax.xml.rpc.holders.BooleanHolder; +import javax.xml.rpc.holders.BooleanWrapperHolder; +import javax.xml.rpc.holders.ByteArrayHolder; +import javax.xml.rpc.holders.ByteHolder; +import javax.xml.rpc.holders.ByteWrapperHolder; +import javax.xml.rpc.holders.CalendarHolder; +import javax.xml.rpc.holders.DoubleHolder; +import javax.xml.rpc.holders.DoubleWrapperHolder; +import javax.xml.rpc.holders.FloatHolder; +import javax.xml.rpc.holders.FloatWrapperHolder; +import javax.xml.rpc.holders.IntHolder; +import javax.xml.rpc.holders.IntegerWrapperHolder; +import javax.xml.rpc.holders.LongHolder; +import javax.xml.rpc.holders.LongWrapperHolder; +import javax.xml.rpc.holders.ObjectHolder; +import javax.xml.rpc.holders.QNameHolder; +import javax.xml.rpc.holders.ShortHolder; +import javax.xml.rpc.holders.ShortWrapperHolder; +import javax.xml.rpc.holders.StringHolder; + +import org.apache.geronimo.common.DeploymentException; +import org.apache.geronimo.kernel.ClassLoading; +import org.apache.geronimo.schema.SchemaConversionUtils; +import org.apache.geronimo.xbeans.j2ee.ExceptionMappingType; +import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument; +import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType; +import org.apache.geronimo.xbeans.j2ee.PackageMappingType; +import org.apache.geronimo.xbeans.j2ee.PortComponentHandlerType; +import org.apache.geronimo.xbeans.j2ee.PortComponentType; +import org.apache.geronimo.xbeans.j2ee.ServiceEndpointInterfaceMappingType; +import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType; +import org.apache.geronimo.xbeans.j2ee.ServiceImplBeanType; +import org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType; +import org.apache.geronimo.xbeans.j2ee.WebservicesDocument; +import org.apache.geronimo.xbeans.j2ee.WebservicesType; +import org.apache.xmlbeans.XmlCursor; +import org.apache.xmlbeans.XmlException; +import org.apache.xmlbeans.XmlObject; +import org.w3.x2001.xmlSchema.ComplexType; +import org.w3.x2001.xmlSchema.SchemaDocument; +import org.w3c.dom.Element; +import org.xml.sax.InputSource; + +/** + * @version $Rev: $ $Date: $ + */ +public class WSDescriptorParser { + + public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB) throws DeploymentException { + try { + WebservicesDocument webservicesDocument = WebservicesDocument.Factory.parse(wsDDUrl); + SchemaConversionUtils.validateDD(webservicesDocument); + WebservicesType webservicesType = webservicesDocument.getWebservices(); + return parseWebServiceDescriptor(webservicesType, moduleFile, isEJB); + } catch (XmlException e) { + throw new DeploymentException("Could not read descriptor document", e); + } catch (IOException e) { + return null; + } + + } + + public static Map parseWebServiceDescriptor(WebservicesType webservicesType, JarFile moduleFile, boolean isEJB) throws DeploymentException { + Map portMap = new HashMap(); + WebserviceDescriptionType[] webserviceDescriptions = webservicesType.getWebserviceDescriptionArray(); + for (int i = 0; i < webserviceDescriptions.length; i++) { + WebserviceDescriptionType webserviceDescription = webserviceDescriptions[i]; + URI wsdlURI = null; + try { + wsdlURI = new URI(webserviceDescription.getWsdlFile().getStringValue().trim()); + } catch (URISyntaxException e) { + throw new DeploymentException("could not construct wsdl uri from " + webserviceDescription.getWsdlFile().getStringValue(), e); + } + URI jaxrpcMappingURI = null; + try { + jaxrpcMappingURI = new URI(webserviceDescription.getJaxrpcMappingFile().getStringValue().trim()); + } catch (URISyntaxException e) { + throw new DeploymentException("Could not construct jaxrpc mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e); + } + Definition definition = readWsdl(moduleFile, wsdlURI); + JavaWsdlMappingType javaWsdlMapping = readJaxrpcMapping(moduleFile, jaxrpcMappingURI); + PortComponentType[] portComponents = webserviceDescription.getPortComponentArray(); + for (int j = 0; j < portComponents.length; j++) { + PortComponentType portComponent = portComponents[j]; + String portComponentName = portComponent.getPortComponentName().getStringValue().trim(); + QName portQName = portComponent.getWsdlPort().getQNameValue(); + String seiInterfaceName = portComponent.getServiceEndpointInterface().getStringValue().trim(); + ServiceImplBeanType serviceImplBeanType = portComponent.getServiceImplBean(); + if (isEJB == serviceImplBeanType.isSetServletLink()) { + throw new DeploymentException("Wrong kind of web service described in web service descriptor: expected " + (isEJB? "EJB": "POJO(Servlet)")); + } + String linkName; + if (serviceImplBeanType.isSetServletLink()) { + linkName = serviceImplBeanType.getServletLink().getStringValue().trim(); + } else { + linkName = serviceImplBeanType.getEjbLink().getStringValue().trim(); + } + PortComponentHandlerType[] handlers = portComponent.getHandlerArray(); + PortInfo portInfo = new PortInfo(portComponentName, portQName, definition, javaWsdlMapping, seiInterfaceName, handlers); + if (portMap.put(linkName, portInfo) != null) { + throw new DeploymentException("Ambiguous description of port associated with j2ee component " + linkName); + } + } + } + return portMap; + } + + public static JavaWsdlMappingType readJaxrpcMapping(JarFile moduleFile, URI jaxrpcMappingURI) throws DeploymentException { + JavaWsdlMappingType mapping; + InputStream jaxrpcInputStream = null; + try { + jaxrpcInputStream = moduleFile.getInputStream(moduleFile.getEntry(jaxrpcMappingURI.toString())); + } catch (IOException e) { + throw new DeploymentException("Could not open stream to jaxrpc mapping document", e); + } + JavaWsdlMappingDocument mappingDocument = null; + try { + mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcInputStream); + } catch (XmlException e) { + throw new DeploymentException("Could not parse jaxrpc mapping document", e); + } catch (IOException e) { + throw new DeploymentException("Could not read jaxrpc mapping document", e); + } + mapping = mappingDocument.getJavaWsdlMapping(); + return mapping; + } + + public static Definition readWsdl(JarFile moduleFile, URI wsdlURI) throws DeploymentException { + Definition definition; + JarWSDLLocator wsdlLocator = new JarWSDLLocator(moduleFile, wsdlURI); + WSDLFactory wsdlFactory = null; + try { + wsdlFactory = WSDLFactory.newInstance(); + } catch (WSDLException e) { + throw new DeploymentException("Could not create WSDLFactory", e); + } + WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); + try { + definition = wsdlReader.readWSDL(wsdlLocator); + } catch (WSDLException e) { + throw new DeploymentException("Failed to read wsdl document", e); + } + return definition; + } + + /** + * Find all the top level complex types in the schemas in the definitions' types. + * Put them in a map from complex type QName to schema fragment. + * TODO it is not clear what happens with included schemas. + * + * @param definition + * @return + * @throws DeploymentException + */ + public static Map getComplexTypesInWsdl(Definition definition) throws DeploymentException { + Map complexTypeMap = new HashMap(); + Types types = definition.getTypes(); + Map namespaceMap = definition.getNamespaces(); + if (types != null) { + List schemas = types.getExtensibilityElements(); + for (Iterator iterator = schemas.iterator(); iterator.hasNext();) { + Object o = iterator.next(); + if (o instanceof Schema) { + Schema unknownExtensibilityElement = (Schema) o; + QName elementType = unknownExtensibilityElement.getElementType(); + if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { + Element element = unknownExtensibilityElement.getElement(); + try { + XmlObject xmlObject = SchemaConversionUtils.parse(element); + XmlCursor cursor = xmlObject.newCursor(); + try { + cursor.toFirstContentToken(); + for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) { + Map.Entry entry = (Map.Entry) namespaces.next(); + cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue()); + } + } finally { + cursor.dispose(); + } + SchemaDocument schemaDoc = (SchemaDocument) xmlObject.changeType(SchemaDocument.type); + SchemaConversionUtils.validateDD(schemaDoc); + SchemaDocument.Schema schema = schemaDoc.getSchema(); + String targetNamespace = schema.getTargetNamespace(); + ComplexType[] complexTypes = schema.getComplexTypeArray(); + for (int j = 0; j < complexTypes.length; j++) { + ComplexType complexType = complexTypes[j]; + String complexTypeName = complexType.getName(); + QName complexTypeQName = new QName(targetNamespace, complexTypeName); + complexTypeMap.put(complexTypeQName, complexType); + } + } catch (XmlException e) { + throw new DeploymentException("Invalid schema in wsdl", e); + } + } else { + //problems?? + } + } else if (o instanceof UnknownExtensibilityElement) { + //This is apparently obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above. + //I'm leaving this in in case this Schema class is not really part of a spec, even though its in javax. + UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o; + QName elementType = unknownExtensibilityElement.getElementType(); + if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { + Element element = unknownExtensibilityElement.getElement(); + try { + XmlObject xmlObject = SchemaConversionUtils.parse(element); + XmlCursor cursor = xmlObject.newCursor(); + try { + cursor.toFirstContentToken(); + for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) { + Map.Entry entry = (Map.Entry) namespaces.next(); + cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue()); + } + } finally { + cursor.dispose(); + } + SchemaDocument schemaDoc = (SchemaDocument) xmlObject.changeType(SchemaDocument.type); + SchemaConversionUtils.validateDD(schemaDoc); + SchemaDocument.Schema schema = schemaDoc.getSchema(); + String targetNamespace = schema.getTargetNamespace(); + ComplexType[] complexTypes = schema.getComplexTypeArray(); + for (int j = 0; j < complexTypes.length; j++) { + ComplexType complexType = complexTypes[j]; + String complexTypeName = complexType.getName(); + QName complexTypeQName = new QName(targetNamespace, complexTypeName); + complexTypeMap.put(complexTypeQName, complexType); + } + } catch (XmlException e) { + throw new DeploymentException("Invalid schema in wsdl", e); + } + } else { + //problems?? + } + } + } + } + return complexTypeMap; + } + + public static Map getExceptionMap(JavaWsdlMappingType mapping) { + Map exceptionMap = new HashMap(); + if (mapping != null) { + ExceptionMappingType[] exceptionMappings = mapping.getExceptionMappingArray(); + for (int i = 0; i < exceptionMappings.length; i++) { + ExceptionMappingType exceptionMapping = exceptionMappings[i]; + QName exceptionMessageQName = exceptionMapping.getWsdlMessage().getQNameValue(); + exceptionMap.put(exceptionMessageQName, exceptionMapping); + } + } + return exceptionMap; + } + + public static String getPackageFromNamespace(String namespace, JavaWsdlMappingType mapping) throws DeploymentException { + PackageMappingType[] packageMappings = mapping.getPackageMappingArray(); + for (int i = 0; i < packageMappings.length; i++) { + PackageMappingType packageMapping = packageMappings[i]; + if (namespace.equals(packageMapping.getNamespaceURI().getStringValue().trim())) { + return packageMapping.getPackageType().getStringValue().trim(); + } + } + throw new DeploymentException("Namespace " + namespace + " was not mapped in jaxrpc mapping file"); + } + + private static final Map rpcHolderClasses = new HashMap(); + + static { + rpcHolderClasses.put(BigDecimal.class, BigDecimalHolder.class); + rpcHolderClasses.put(BigInteger.class, BigIntegerHolder.class); + rpcHolderClasses.put(boolean.class, BooleanHolder.class); + rpcHolderClasses.put(Boolean.class, BooleanWrapperHolder.class); + rpcHolderClasses.put(byte[].class, ByteArrayHolder.class); + rpcHolderClasses.put(byte.class, ByteHolder.class); + rpcHolderClasses.put(Byte.class, ByteWrapperHolder.class); + rpcHolderClasses.put(Calendar.class, CalendarHolder.class); + rpcHolderClasses.put(double.class, DoubleHolder.class); + rpcHolderClasses.put(Double.class, DoubleWrapperHolder.class); + rpcHolderClasses.put(float.class, FloatHolder.class); + rpcHolderClasses.put(Float.class, FloatWrapperHolder.class); + rpcHolderClasses.put(int.class, IntHolder.class); + rpcHolderClasses.put(Integer.class, IntegerWrapperHolder.class); + rpcHolderClasses.put(long.class, LongHolder.class); + rpcHolderClasses.put(Long.class, LongWrapperHolder.class); + rpcHolderClasses.put(Object.class, ObjectHolder.class); + rpcHolderClasses.put(QName.class, QNameHolder.class); + rpcHolderClasses.put(short.class, ShortHolder.class); + rpcHolderClasses.put(Short.class, ShortWrapperHolder.class); + rpcHolderClasses.put(String.class, StringHolder.class); + } + + public static Class getHolderType(String paramJavaTypeName, boolean isInOnly, QName typeQName, boolean isComplexType, JavaWsdlMappingType mapping, ClassLoader classLoader) throws DeploymentException { + Class paramJavaType = null; + if (isInOnly) { + //IN parameters just use their own type + try { + paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("could not load parameter type", e); + } + return paramJavaType; + } else { + //INOUT and OUT parameters use holders. See jaxrpc spec 4.3.5 + String holderName; + if (isComplexType) { + //complex types get mapped: + //package is determined from the namespace to package map + ".holders" + //class name is the complex type QNMAne local part + "Holder", with the initial character uppercased. + String namespace = typeQName.getNamespaceURI(); + String packageName = WSDescriptorParser.getPackageFromNamespace(namespace, mapping); + StringBuffer buf = new StringBuffer(packageName.length() + typeQName.getLocalPart().length() + 14); + buf.append(packageName).append(".holders.").append(typeQName.getLocalPart()).append("Holder"); + buf.setCharAt(packageName.length() + 9, Character.toUpperCase(typeQName.getLocalPart().charAt(0))); + holderName = buf.toString(); + } else { + //see if it is in the primitive type and simple type mapping + try { + paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("could not load parameter type", e); + } + Class holder = (Class) rpcHolderClasses.get(paramJavaType); + if (holder != null) { + return holder; + } + //Otherwise, the holder must be in: + //package same as type's package + ".holders" + //class name same as type name + "Holder" + String paramTypeName = paramJavaType.getName(); + StringBuffer buf = new StringBuffer(paramTypeName.length() + 14); + int dot = paramTypeName.lastIndexOf("."); + //foo.Bar >>> foo.holders.BarHolder + buf.append(paramTypeName.substring(0, dot)).append(".holders").append(paramTypeName.substring(dot)).append("Holder"); + holderName = buf.toString(); + } + try { + Class holder = ClassLoading.loadClass(holderName, classLoader); + return holder; + } catch (ClassNotFoundException e) { + throw new DeploymentException("Could not load holder class", e); + } + } + } + + public static ServiceEndpointMethodMappingType getMethodMappingForOperation(String operationName, ServiceEndpointMethodMappingType[] methodMappings) throws DeploymentException { + for (int i = 0; i < methodMappings.length; i++) { + ServiceEndpointMethodMappingType methodMapping = methodMappings[i]; + if (operationName.equals(methodMapping.getWsdlOperation().getStringValue())) { + return methodMapping; + } + } + throw new DeploymentException("No method found for operation named " + operationName); + } + + public static ServiceEndpointInterfaceMappingType getServiceEndpointInterfaceMapping(ServiceEndpointInterfaceMappingType[] endpointMappings, QName portTypeQName) throws DeploymentException { + for (int i = 0; i < endpointMappings.length; i++) { + ServiceEndpointInterfaceMappingType endpointMapping = endpointMappings[i]; + QName testPortQName = endpointMapping.getWsdlPortType().getQNameValue(); + if (portTypeQName.equals(testPortQName)) { + return endpointMapping; + } + } + throw new DeploymentException("Could not find service endpoint interface for port named " + portTypeQName); + } + + public static ExtensibilityElement getExtensibilityElement(Class clazz, List extensibilityElements) throws DeploymentException { + for (Iterator iterator = extensibilityElements.iterator(); iterator.hasNext();) { + ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next(); + if (clazz.isAssignableFrom(extensibilityElement.getClass())) { + return extensibilityElement; + } + } + throw new DeploymentException("No element of class " + clazz.getName() + " found"); + } + + static class JarWSDLLocator implements WSDLLocator { + + private final JarFile moduleFile; + private final URI wsdlURI; + private URI latestImportURI; + + public JarWSDLLocator(JarFile moduleFile, URI wsdlURI) { + this.moduleFile = moduleFile; + this.wsdlURI = wsdlURI; + } + + public InputSource getBaseInputSource() { + InputStream wsdlInputStream = null; + try { + wsdlInputStream = moduleFile.getInputStream(moduleFile.getEntry(wsdlURI.toString())); + } catch (IOException e) { + throw new RuntimeException("Could not open stream to wsdl file", e); + } + return new InputSource(wsdlInputStream); + } + + public String getBaseURI() { + return wsdlURI.toString(); + } + + public InputSource getImportInputSource(String parentLocation, String relativeLocation) { + URI parentURI = URI.create(parentLocation); + latestImportURI = parentURI.resolve(relativeLocation); + InputStream importInputStream = null; + try { + importInputStream = moduleFile.getInputStream(moduleFile.getEntry(latestImportURI.toString())); + } catch (IOException e) { + throw new RuntimeException("Could not open stream to import file", e); + } + return new InputSource(importInputStream); + } + + public String getLatestImportURI() { + return latestImportURI.toString(); + } + } +} Modified: geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original) +++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Sun Feb 20 20:43:02 2005 @@ -48,11 +48,10 @@ import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; -import javax.xml.rpc.Service; import junit.framework.TestCase; -import org.apache.axis.soap.SOAPConstants; import org.apache.axis.constants.Style; +import org.apache.axis.soap.SOAPConstants; import org.apache.geronimo.axis.builder.bookquote.BookQuote; import org.apache.geronimo.axis.builder.bookquote.BookQuoteService; import org.apache.geronimo.axis.builder.interop.InteropLab; @@ -63,7 +62,6 @@ import org.apache.geronimo.axis.client.OperationInfo; import org.apache.geronimo.axis.client.SEIFactory; import org.apache.geronimo.axis.client.ServiceImpl; -import org.apache.geronimo.axis.client.ServiceReference; import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.deployment.DeploymentContext; import org.apache.geronimo.deployment.util.UnpackedJarFile; @@ -112,19 +110,6 @@ recursiveDelete(tmpbasedir); } - public void testServiceRefCreation() throws Exception { - AxisBuilder builder = new AxisBuilder(); - - ServiceReference ref = builder.createServiceReference(MockService.class, null, null, null, null, null, context, isolatedCl); - Object instance = ref.getContent(); - assertTrue(instance instanceof Service); - - ClassLoader cl = context.getClassLoader(null); - Class loadedType = cl.loadClass(instance.getClass().getName()); - assertTrue(Service.class.isAssignableFrom(loadedType)); - assertTrue(instance.getClass() != loadedType); - } - public void testServiceProxy() throws Exception { //construct the SEI proxy Map portMap = new HashMap(); @@ -263,8 +248,7 @@ WSDLFactory factory = WSDLFactory.newInstance(); WSDLReader reader = factory.newWSDLReader(); Definition definition = reader.readWSDL(wsdlFile.toURI().toString()); - AxisBuilder builder = new AxisBuilder(); - Map complexTypeMap = builder.getComplexTypesInWsdl(definition); + Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(definition); assertEquals(7, complexTypeMap.size()); } Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java Sun Feb 20 20:43:02 2005 @@ -18,6 +18,7 @@ import java.util.jar.JarFile; import java.util.LinkedHashSet; +import java.util.Map; import java.net.URI; import java.net.URISyntaxException; import java.io.IOException; @@ -33,9 +34,11 @@ private final LinkedHashSet webClassPath = new LinkedHashSet(); private String contextRoot; + private final Map portMap; - public WebModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) { + public WebModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, Map portMap) { super(standAlone, configId, parentId, moduleFile, targetPath, specDD, vendorDD, originalSpecDD); + this.portMap = portMap; } public String getContextRoot() { @@ -48,6 +51,10 @@ public ConfigurationModuleType getType() { return ConfigurationModuleType.WAR; + } + + public Map getPortMap() { + return portMap; } public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException { Added: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?view=auto&rev=154623 ============================================================================== --- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java (added) +++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java Sun Feb 20 20:43:02 2005 @@ -0,0 +1,47 @@ +/** + * + * Copyright 2003-2004 The Apache Software Foundation + * + * 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.geronimo.j2ee.deployment; + +import org.apache.geronimo.common.DeploymentException; +import org.apache.geronimo.gbean.GBeanData; + +/** + * @version $Rev: $ $Date: $ + */ +public interface WebServiceBuilder { + + //obviously these need the deployment descriptors, but I'm not sure in what form yet. + /** + * configure the supplied GBeanData to implement the POJO web service described in the deployment descriptor. + * The GBeanData will be for a ServletHolder like gbean that is adapted to holding a ws stack that talks to a + * POJO web service. The web deployer is responsible for filling in the standard servlet info such as init params. + * @param targetGBean + * @param portInfo + * @param seiClassName + * @throws DeploymentException + */ + void configurePOJO(GBeanData targetGBean, Object portInfo, String seiClassName) throws DeploymentException; + + /** + * configure the supplied EJBContainer gbeandata to implement the ejb web service described in the deployment descriptor + * N.B. this method is a complete guess and should be replaced by something useable right away! + * @param targetGBean + * @throws DeploymentException + */ + void configureEJB(GBeanData targetGBean, Object portInfoObject, String seiClassName) throws DeploymentException; + +} Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Sun Feb 20 20:43:02 2005 @@ -75,6 +75,7 @@ private static final ObjectName transactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer"); private static final ObjectName nonTransactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer"); private URI defaultParentId; + private static final Map portMap = null; protected void setUp() throws Exception { defaultParentId = new URI("org/apache/geronimo/Server"); @@ -87,7 +88,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear14/test-ear.ear")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -104,7 +105,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear14/test-naked-ear.ear")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -121,7 +122,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear13/test-ear.ear")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -138,7 +139,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear13/test-naked-ear.ear")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -155,7 +156,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/full/")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -172,7 +173,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/naked/")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -189,7 +190,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/alt-dd/")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -206,7 +207,7 @@ earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/alt-dd.ear")); ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot = "test"; - webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null); } Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Sun Feb 20 20:43:02 2005 @@ -20,6 +20,7 @@ import java.net.URL; import java.net.URI; import java.util.jar.JarFile; +import java.util.Map; import javax.management.ObjectName; @@ -34,13 +35,14 @@ public WebModule webModule; public ClassLoader cl; public String contextRoot; + private Map portMap = null; public Module createModule(File plan, JarFile moduleFile) throws DeploymentException { - return new WebModule(true, null, null, moduleFile, "war", null, null, null); + return new WebModule(true, null, null, moduleFile, "war", null, null, null, portMap); } public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, URI earConfigId) throws DeploymentException { - return new WebModule(false, null, null, moduleFile, targetPath, null, null, null); + return new WebModule(false, null, null, moduleFile, targetPath, null, null, null, portMap); } public void installModule(JarFile earFile, EARContext earContext, Module webModule) throws DeploymentException { Modified: geronimo/trunk/modules/j2ee-schema/maven.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/maven.xml?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/j2ee-schema/maven.xml (original) +++ geronimo/trunk/modules/j2ee-schema/maven.xml Sun Feb 20 20:43:02 2005 @@ -28,7 +28,7 @@ <preGoal name="java:compile"> <xmlbeans:schema2java sourcedir="${basedir}/src" - sourceschema="j2ee_1_4schema/application_1_4.xsd,j2ee_1_4schema/j2ee_jaxrpc_mapping_1_1.xsd,j2ee_1_3schema/connector_1_0.xsd,j2ee_1_4schema/j2ee_1_4.xsd,j2ee_1_4schema/connector_1_5.xsd,j2ee_1_4schema/ejb-jar_2_1.xsd,j2ee_1_4schema/web-app_2_4.xsd,j2ee_1_4schema/application-client_1_4.xsd" + sourceschema="j2ee_1_4schema/application_1_4.xsd,j2ee_1_4schema/j2ee_jaxrpc_mapping_1_1.xsd,j2ee_1_3schema/connector_1_0.xsd,j2ee_1_4schema/j2ee_1_4.xsd,j2ee_1_4schema/connector_1_5.xsd,j2ee_1_4schema/ejb-jar_2_1.xsd,j2ee_1_4schema/web-app_2_4.xsd,j2ee_1_4schema/application-client_1_4.xsd,j2ee_1_4schema/j2ee_web_services_1_1.xsd" xmlconfigs="${basedir}/src/conf/xmlconfig.xml" targetdir="${basedir}/target/xmlbeans" cataloglocation="${basedir}/src/catalog/resolver-catalog.xml"/> Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java (original) +++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java Sun Feb 20 20:43:02 2005 @@ -95,6 +95,7 @@ public static final String PERSISTENT_CONFIGURATION_LIST = "PersistentConfigurationList"; //duplicated in FileConfigurationList // public static final String URL_PATTERN = "URLPattern"; public static String DEFAULT_SERVLET = "DefaultServlet"; + public static final String SERVLET_WEB_SERVICE_TEMPLATE = "ServletWebServiceTemplate"; public static ObjectName getDomainName(String j2eeDomainName, J2eeContext context) throws MalformedObjectNameException { Properties props = new Properties(); Modified: geronimo/trunk/modules/jetty-builder/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/project.xml?view=diff&r1=154622&r2=154623 ============================================================================== --- geronimo/trunk/modules/jetty-builder/project.xml (original) +++ geronimo/trunk/modules/jetty-builder/project.xml Sun Feb 20 20:43:02 2005 @@ -172,6 +172,13 @@ <version>${pom.currentVersion}</version> </dependency> + <!--todo put WSDescriptorParser somewhere else and remove this dependency--> + <dependency> + <groupId>geronimo</groupId> + <artifactId>geronimo-axis-builder</artifactId> + <version>${pom.currentVersion}</version> + </dependency> + <dependency> <groupId>geronimo-spec</groupId> <artifactId>geronimo-spec-jta</artifactId> @@ -231,6 +238,18 @@ </dependency> <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-jaxrpc</artifactId> + <version>${geronimo_spec_jaxrpc_version}</version> + </dependency> + + <dependency> + <groupId>geronimo-spec</groupId> + <artifactId>geronimo-spec-saaj</artifactId> + <version>${geronimo_spec_saaj_version}</version> + </dependency> + + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>${commons_logging_version}</version> @@ -294,6 +313,13 @@ <version>${tranql_version}</version> <url>http://tranql.codehaus.org</url> </dependency> + + <dependency> + <groupId>axis</groupId> + <artifactId>axis-wsdl4j</artifactId> + <version>${axis_wsdl4j_version}</version> + </dependency> + </dependencies>