Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 27675 invoked from network); 21 Feb 2005 04:43:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Feb 2005 04:43:12 -0000 Received: (qmail 21668 invoked by uid 500); 21 Feb 2005 04:43:12 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 21518 invoked by uid 500); 21 Feb 2005 04:43:11 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 21504 invoked by uid 99); 21 Feb 2005 04:43:11 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 20 Feb 2005 20:43:08 -0800 Received: (qmail 27605 invoked by uid 65534); 21 Feb 2005 04:43:07 -0000 Message-ID: <20050221044307.27604.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Mon, 21 Feb 2005 04:43:07 -0000 Subject: svn commit: r154623 [1/2] - in geronimo/trunk/modules: assembly/src/plan/ axis-builder/ axis-builder/src/java/org/apache/geronimo/axis/builder/ axis-builder/src/test/org/apache/geronimo/axis/builder/ axis/src/java/org/apache/geronimo/axis/client/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ j2ee-schema/ j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/ jetty-builder/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jetty/ tomcat/src/java/org/apache/geronimo/tomcat/deployment/ To: scm@geronimo.apache.org From: djencks@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: djencks Date: Sun Feb 20 20:43:02 2005 New Revision: 154623 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D154623 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/b= uilder/PortInfo.java geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/WSDescriptorParser.java geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/WebServiceBuilder.java geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyAx= isPOJOWebService.java Removed: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/client/Se= rviceReference.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/b= uilder/AxisBuilder.java geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/b= uilder/ServiceReferenceTest.java geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/WebModule.java geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/EARConfigBuilderTest.java geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/MockWARConfigBuilder.java geronimo/trunk/modules/j2ee-schema/maven.xml geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjec= tnames/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/JettySe= rvletHolder.java geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deplo= yment/TomcatModuleBuilder.java Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-pl= an.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan= /j2ee-runtime-deployer-plan.xml?view=3Ddiff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ index.html,index.htm,index= .jsp geronimo.server:name= =3DJettyWebContainer,* geronimo.server:j2eeType=3DDef= aultServlet,J2EEModule=3Dorg/apache/geronimo/RuntimeDeployer,* + geronimo.server:J2EEApp= lication=3Dnull,J2EEModule=3Dorg/apache/geronimo/RuntimeDeployer,J2EEServer= =3Dgeronimo,j2eeType=3DServletWebServiceTemplate,name=3DAxisPOJOTemplate + geronimo.server:J2EEApplicat= ion=3Dnull,J2EEModule=3Dorg/apache/geronimo/RuntimeDeployer,J2EEServer=3Dge= ronimo,j2eeType=3DModuleBuilder,name=3DWebServiceBuilder *:name=3DRepository,* =20 - + default org.mortbay.jetty.servlet.Default= 0 @@ -141,7 +143,7 @@ / =20 - + jsp org.apache.jasper.servlet.JspServ= let 0 @@ -150,6 +152,11 @@ fork=3Dfalse xpoweredBy=3Dfalse *.jsp,*.jspf,*.jspx,*.xsp + + + + dummy + =20 Modified: geronimo/trunk/modules/axis-builder/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/proj= ect.xml?view=3Ddiff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ =20 + geronimo-spec + geronimo-spec-jaxrpc + ${geronimo_spec_jaxrpc_version} + + + + geronimo-spec + geronimo-spec-saaj + ${geronimo_spec_saaj_version} + + + + geronimo-spec + geronimo-spec-qname + ${geronimo_spec_qname_version} + + + geronimo geronimo-axis ${pom.currentVersion} @@ -197,12 +215,6 @@ =20 axis - axis-jaxrpc - ${axis_jaxrpc_version} - - - - axis axis ${axis_version} @@ -212,11 +224,7 @@ commons-discovery ${axis_commons_discovery_version} - - axis - axis-saaj - ${axis_saaj_version} - + axis axis-wsdl4j 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=3Ddiff&r1=3D154= 622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/AxisBuilder.java (original) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/AxisBuilder.java Sun Feb 20 20:43:02 2005 @@ -18,18 +18,14 @@ =20 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; =20 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; =20 /** * @version $Rev: $ $Date: $ */ -public class AxisBuilder implements ServiceReferenceBuilder { +public class AxisBuilder implements ServiceReferenceBuilder, WebServiceBui= lder { private static final Class[] SERVICE_CONSTRUCTOR_TYPES =3D new Class[]= {Map.class, Map.class}; =20 - private static final URI ENHANCED_LOCATION =3D URI.create("cglib/"); private static final SOAPConstants SOAP_VERSION =3D SOAPConstants.SOAP= 11_CONSTANTS; =20 - public ServiceReference createServiceReference(Class serviceInterface,= URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRe= fMap, List handlers, DeploymentContext deploymentContext, ClassLoader class= Loader) throws DeploymentException { =20 - Enhancer enhancer =3D new Enhancer(); - enhancer.setClassLoader(classLoader); - enhancer.setSuperclass(ServiceImpl.class); - enhancer.setInterfaces(new Class[]{serviceInterface}); - enhancer.setCallbackFilter(new NoOverrideCallbackFilter(Service.cl= ass)); - enhancer.setCallbackTypes(new Class[]{NoOp.class, MethodIntercepto= r=2Eclass}); - enhancer.setUseFactory(false); - ByteArrayRetrievingGeneratorStrategy strategy =3D new ByteArrayRet= rievingGeneratorStrategy(); - enhancer.setStrategy(strategy); - Class enhanced =3D enhancer.createClass(); + //WebServiceBuilder + public void configurePOJO(GBeanData targetGBean, Object portInfoObject= , String seiClassName) throws DeploymentException { + PortInfo portInfo =3D (PortInfo)portInfoObject; + System.out.println("NOT CONFIGURING WEB SERVICE " + portInfo.getPo= rtName()); + } + + public void configureEJB(GBeanData targetGBean, Object portInfoObject,= String seiClassName) throws DeploymentException { =20 - saveClass(deploymentContext, enhanced.getName(), strategy.getClass= Bytes()); - return new ServiceReference(enhanced, null, null, null); } =20 + + //ServicereferenceBuilder public Object createService(Class serviceInterface, URI wsdlURI, URI j= axrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerI= nfos, DeploymentContext deploymentContext, Module module, ClassLoader class= Loader) throws DeploymentException { JarFile moduleFile =3D module.getModuleFile(); Definition definition =3D null; JavaWsdlMappingType mapping =3D null; if (wsdlURI !=3D null) { - JarWSDLLocator wsdlLocator =3D new JarWSDLLocator(moduleFile, = wsdlURI); - WSDLFactory wsdlFactory =3D null; - try { - wsdlFactory =3D WSDLFactory.newInstance(); - } catch (WSDLException e) { - throw new DeploymentException("Could not create WSDLFactor= y", e); - } - WSDLReader wsdlReader =3D wsdlFactory.newWSDLReader(); - definition =3D null; - try { - definition =3D wsdlReader.readWSDL(wsdlLocator); - } catch (WSDLException e) { - throw new DeploymentException("Failed to read wsdl documen= t", e); - } + definition =3D WSDescriptorParser.readWsdl(moduleFile, wsdlURI= ); =20 - InputStream jaxrpcInputStream =3D null; - try { - jaxrpcInputStream =3D moduleFile.getInputStream(moduleFile= .getEntry(jaxrpcMappingURI.toString())); - } catch (IOException e) { - throw new DeploymentException("Could not open stream to ja= xrpc mapping document", e); - } - JavaWsdlMappingDocument mappingDocument =3D null; - try { - mappingDocument =3D JavaWsdlMappingDocument.Factory.parse(= jaxrpcInputStream); - } catch (XmlException e) { - throw new DeploymentException("Could not parse jaxrpc mapp= ing document", e); - } catch (IOException e) { - throw new DeploymentException("Could not read jaxrpc mappi= ng document", e); - } - mapping =3D mappingDocument.getJavaWsdlMapping(); + mapping =3D WSDescriptorParser.readJaxrpcMapping(moduleFile, j= axrpcMappingURI); } =20 Object service =3D createService(serviceInterface, definition, map= ping, serviceQName, SOAP_VERSION, handlerInfos, deploymentContext, module, = classLoader); @@ -282,15 +209,15 @@ =20 Map wsdlPortMap =3D service.getPorts(); =20 - Map complexTypeMap =3D getComplexTypesInWsdl(definition); - Map exceptionMap =3D getExceptionMap(mapping); + Map complexTypeMap =3D WSDescriptorParser.getComplexTypesInWsdl(de= finition); + Map exceptionMap =3D WSDescriptorParser.getExceptionMap(mapping); =20 for (Iterator iterator =3D wsdlPortMap.entrySet().iterator(); iter= ator.hasNext();) { Map.Entry entry =3D (Map.Entry) iterator.next(); String portName =3D (String) entry.getKey(); Port port =3D (Port) entry.getValue(); =20 - SOAPAddress soapAddress =3D (SOAPAddress) getExtensibilityElem= ent(SOAPAddress.class, port.getExtensibilityElements()); + SOAPAddress soapAddress =3D (SOAPAddress) WSDescriptorParser.g= etExtensibilityElement(SOAPAddress.class, port.getExtensibilityElements()); String locationURIString =3D soapAddress.getLocationURI(); URL location =3D null; try { @@ -300,7 +227,7 @@ } =20 Binding binding =3D port.getBinding(); - SOAPBinding soapBinding =3D (SOAPBinding) getExtensibilityElem= ent(SOAPBinding.class, binding.getExtensibilityElements()); + SOAPBinding soapBinding =3D (SOAPBinding) WSDescriptorParser.g= etExtensibilityElement(SOAPBinding.class, binding.getExtensibilityElements(= )); // String transportURI =3D soapBinding.getTransportURI(); String portStyleString =3D soapBinding.getStyle(); Style portStyle =3D Style.getStyle(portStyleString); @@ -332,7 +259,7 @@ } else { //complete jaxrpc mapping file supplied QName portTypeQName =3D portType.getQName(); - ServiceEndpointInterfaceMappingType endpointMapping =3D ge= tServiceEndpointInterfaceMapping(endpointMappings, portTypeQName); + ServiceEndpointInterfaceMappingType endpointMapping =3D WS= DescriptorParser.getServiceEndpointInterfaceMapping(endpointMappings, portT= ypeQName); String fqcn =3D endpointMapping.getServiceEndpointInterfac= e().getStringValue(); try { serviceEndpointInterface =3D classLoader.loadClass(fqc= n); @@ -345,8 +272,9 @@ int i =3D 0; for (Iterator ops =3D operations.iterator(); ops.hasNext()= ;) { Operation operation =3D (Operation) ops.next(); - BindingOperation bindingOperation =3D binding.getBindi= ngOperation(operation.getName(), operation.getInput().getName(), operation.= getOutput() =3D=3D null ? null : operation.getOutput().getName()); - ServiceEndpointMethodMappingType methodMapping =3D get= MethodMappingForOperation(operation, methodMappings); + String operationName =3D operation.getName(); + BindingOperation bindingOperation =3D binding.getBindi= ngOperation(operationName, operation.getInput().getName(), operation.getOut= put() =3D=3D null ? null : operation.getOutput().getName()); + ServiceEndpointMethodMappingType methodMapping =3D WSD= escriptorParser.getMethodMappingForOperation(operationName, methodMappings); OperationInfo operationInfo =3D buildOperationInfoHeav= yweight(methodMapping, bindingOperation, portStyle, soapVersion, exceptionM= ap, complexTypeMap, mapping, classLoader); operationInfos[i++] =3D operationInfo; } @@ -396,30 +324,6 @@ } } =20 - private Map getExceptionMap(JavaWsdlMappingType mapping) { - Map exceptionMap =3D new HashMap(); - if (mapping !=3D null) { - ExceptionMappingType[] exceptionMappings =3D mapping.getExcept= ionMappingArray(); - for (int i =3D 0; i < exceptionMappings.length; i++) { - ExceptionMappingType exceptionMapping =3D exceptionMapping= s[i]; - QName exceptionMessageQName =3D exceptionMapping.getWsdlMe= ssage().getQNameValue(); - exceptionMap.put(exceptionMessageQName, exceptionMapping); - } - } - return exceptionMap; - } - - private ServiceEndpointMethodMappingType getMethodMappingForOperation(= Operation operation, ServiceEndpointMethodMappingType[] methodMappings) thr= ows DeploymentException { - String operationName =3D operation.getName(); - for (int i =3D 0; i < methodMappings.length; i++) { - ServiceEndpointMethodMappingType methodMapping =3D methodMappi= ngs[i]; - if (operationName.equals(methodMapping.getWsdlOperation().getS= tringValue())) { - return methodMapping; - } - } - throw new DeploymentException("No method found for operation named= " + operationName); - } - private Method getMethodForOperation(Class enhancedServiceEndpointClas= s, Operation operation) throws DeploymentException { Method[] methods =3D enhancedServiceEndpointClass.getMethods(); String opName =3D operation.getName(); @@ -442,7 +346,7 @@ private Class getServiceEndpointInterfaceLightweight(PortType portType= , JavaWsdlMappingType mappings, ClassLoader classLoader) throws DeploymentE= xception { QName portTypeQName =3D portType.getQName(); String portTypeNamespace =3D portTypeQName.getNamespaceURI(); - String portTypePackage =3D getPackageFromNamespace(portTypeNamespa= ce, mappings); + String portTypePackage =3D WSDescriptorParser.getPackageFromNamesp= ace(portTypeNamespace, mappings); StringBuffer shortInterfaceName =3D new StringBuffer(portTypeQName= .getLocalPart()); shortInterfaceName.setCharAt(0, Character.toUpperCase(shortInterfa= ceName.charAt(0))); //TODO just use one buffer! @@ -455,37 +359,6 @@ =20 } =20 - private ServiceEndpointInterfaceMappingType getServiceEndpointInterfac= eMapping(ServiceEndpointInterfaceMappingType[] endpointMappings, QName port= TypeQName) throws DeploymentException { - for (int i =3D 0; i < endpointMappings.length; i++) { - ServiceEndpointInterfaceMappingType endpointMapping =3D endpoi= ntMappings[i]; - QName testPortQName =3D endpointMapping.getWsdlPortType().getQ= NameValue(); - if (portTypeQName.equals(testPortQName)) { - return endpointMapping; - } - } - throw new DeploymentException("Could not find service endpoint int= erface for port named " + portTypeQName); - } - - private ExtensibilityElement getExtensibilityElement(Class clazz, List= extensibilityElements) throws DeploymentException { - for (Iterator iterator =3D extensibilityElements.iterator(); itera= tor.hasNext();) { - ExtensibilityElement extensibilityElement =3D (ExtensibilityEl= ement) iterator.next(); - if (clazz.isAssignableFrom(extensibilityElement.getClass())) { - return extensibilityElement; - } - } - throw new DeploymentException("No element of class " + clazz.getNa= me() + " found"); - } - - private String getPackageFromNamespace(String namespace, JavaWsdlMappi= ngType mapping) throws DeploymentException { - PackageMappingType[] packageMappings =3D mapping.getPackageMapping= Array(); - for (int i =3D 0; i < packageMappings.length; i++) { - PackageMappingType packageMapping =3D packageMappings[i]; - if (namespace.equals(packageMapping.getNamespaceURI().getStrin= gValue().trim())) { - return packageMapping.getPackageType().getStringValue().tr= im(); - } - } - throw new DeploymentException("Namespace " + namespace + " was not= mapped in jaxrpc mapping file"); - } =20 public SEIFactory createSEIFactory(String portName, Class enhancedServ= iceEndpointClass, Object serviceImpl, List typeMappings, URL location, Oper= ationInfo[] operationInfos, List handlerInfoInfos, DeploymentContext deploy= mentContext, ClassLoader classLoader) throws DeploymentException { List handlerInfos =3D buildHandlerInfosForPort(portName, handlerIn= foInfos); @@ -583,12 +456,12 @@ Class returnClass =3D method.getReturnType(); operationDesc.setReturnClass(returnClass); =20 - SOAPOperation soapOperation =3D (SOAPOperation) getExtensibilityEl= ement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); + SOAPOperation soapOperation =3D (SOAPOperation) WSDescriptorParser= .getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibi= lityElements()); String soapActionURI =3D soapOperation.getSoapActionURI(); String styleString =3D soapOperation.getStyle(); Style style =3D Style.getStyle(styleString, defaultStyle); BindingInput bindingInput =3D bindingOperation.getBindingInput(); - SOAPBody soapBody =3D (SOAPBody) getExtensibilityElement(SOAPBody.= class, bindingInput.getExtensibilityElements()); + SOAPBody soapBody =3D (SOAPBody) WSDescriptorParser.getExtensibili= tyElement(SOAPBody.class, bindingInput.getExtensibilityElements()); String useString =3D soapBody.getUse(); Use use =3D Use.getUse(useString); operationDesc.setStyle(style); @@ -700,7 +573,8 @@ //use complexTypeMap boolean isComplexType =3D complexTypeMap.containsKey(partTypeQ= Name); String paramJavaTypeName =3D paramMapping.getParamType().getSt= ringValue().trim(); - Class actualParamJavaType =3D getHolderType(paramJavaTypeName,= mode, partTypeQName, isComplexType, mapping, classLoader); + boolean isInOnly =3D mode =3D=3D ParameterDesc.IN; + Class actualParamJavaType =3D WSDescriptorParser.getHolderType= (paramJavaTypeName, isInOnly, partTypeQName, isComplexType, mapping, classL= oader); =20 ParameterDesc parameterDesc =3D new ParameterDesc(partQName, m= ode, partTypeQName, actualParamJavaType, inHeader, outHeader); parameterDescriptions[position] =3D parameterDesc; @@ -771,12 +645,12 @@ operationDesc.setReturnType(returnType); operationDesc.setReturnClass(returnClass); =20 - SOAPOperation soapOperation =3D (SOAPOperation) getExtensibilityEl= ement(SOAPOperation.class, bindingOperation.getExtensibilityElements()); + SOAPOperation soapOperation =3D (SOAPOperation) WSDescriptorParser= .getExtensibilityElement(SOAPOperation.class, bindingOperation.getExtensibi= lityElements()); String soapActionURI =3D soapOperation.getSoapActionURI(); String styleString =3D soapOperation.getStyle(); Style style =3D Style.getStyle(styleString, defaultStyle); BindingInput bindingInput =3D bindingOperation.getBindingInput(); - SOAPBody soapBody =3D (SOAPBody) getExtensibilityElement(SOAPBody.= class, bindingInput.getExtensibilityElements()); + SOAPBody soapBody =3D (SOAPBody) WSDescriptorParser.getExtensibili= tyElement(SOAPBody.class, bindingInput.getExtensibilityElements()); String useString =3D soapBody.getUse(); Use use =3D Use.getUse(useString); operationDesc.setStyle(style); @@ -831,7 +705,7 @@ QName elementType =3D (QName) elementMap.get(elementNa= me); String javaElementTypeName; if (complexTypeMap.containsKey(elementType)) { - String packageName =3D getPackageFromNamespace(ele= mentType.getNamespaceURI(), mapping); + String packageName =3D WSDescriptorParser.getPacka= geFromNamespace(elementType.getNamespaceURI(), mapping); javaElementTypeName =3D packageName + "." + elemen= tType.getLocalPart(); } else { //TODO finish this @@ -866,188 +740,6 @@ return operationInfo; } =20 - /** - * Find all the top level complex types in the schemas in the definiti= ons' 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 DeploymentExce= ption { - Map complexTypeMap =3D new HashMap(); - Types types =3D definition.getTypes(); - Map namespaceMap =3D definition.getNamespaces(); - if (types !=3D null) { - List schemas =3D types.getExtensibilityElements(); - for (Iterator iterator =3D schemas.iterator(); iterator.hasNex= t();) { - Object o =3D iterator.next(); - if (o instanceof Schema) { - Schema unknownExtensibilityElement =3D (Schema) o; - QName elementType =3D unknownExtensibilityElement.getE= lementType(); - if (new QName("http://www.w3.org/2001/XMLSchema", "sch= ema").equals(elementType)) { - Element element =3D unknownExtensibilityElement.ge= tElement(); - try { - XmlObject xmlObject =3D SchemaConversionUtils.= parse(element); - XmlCursor cursor =3D xmlObject.newCursor(); - try { - cursor.toFirstContentToken(); - for (Iterator namespaces =3D namespaceMap.= entrySet().iterator(); namespaces.hasNext();) { - Map.Entry entry =3D (Map.Entry) namesp= aces.next(); - cursor.insertNamespace((String) entry.= getKey(), (String) entry.getValue()); - } - } finally { - cursor.dispose(); - } - SchemaDocument schemaDoc =3D (SchemaDocument) = xmlObject.changeType(SchemaDocument.type); - SchemaConversionUtils.validateDD(schemaDoc); - SchemaDocument.Schema schema =3D schemaDoc.get= Schema(); - String targetNamespace =3D schema.getTargetNam= espace(); - ComplexType[] complexTypes =3D schema.getCompl= exTypeArray(); - for (int j =3D 0; j < complexTypes.length; j++= ) { - ComplexType complexType =3D complexTypes[j= ]; - String complexTypeName =3D complexType.get= Name(); - QName complexTypeQName =3D new QName(targe= tNamespace, complexTypeName); - complexTypeMap.put(complexTypeQName, compl= exType); - } - } 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-RC= 3=2Ejar 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 unknownExtensibilityElemen= t =3D (UnknownExtensibilityElement) o; - QName elementType =3D unknownExtensibilityElement.getE= lementType(); - if (new QName("http://www.w3.org/2001/XMLSchema", "sch= ema").equals(elementType)) { - Element element =3D unknownExtensibilityElement.ge= tElement(); - try { - XmlObject xmlObject =3D SchemaConversionUtils.= parse(element); - XmlCursor cursor =3D xmlObject.newCursor(); - try { - cursor.toFirstContentToken(); - for (Iterator namespaces =3D namespaceMap.= entrySet().iterator(); namespaces.hasNext();) { - Map.Entry entry =3D (Map.Entry) namesp= aces.next(); - cursor.insertNamespace((String) entry.= getKey(), (String) entry.getValue()); - } - } finally { - cursor.dispose(); - } - SchemaDocument schemaDoc =3D (SchemaDocument) = xmlObject.changeType(SchemaDocument.type); - SchemaConversionUtils.validateDD(schemaDoc); - SchemaDocument.Schema schema =3D schemaDoc.get= Schema(); - String targetNamespace =3D schema.getTargetNam= espace(); - ComplexType[] complexTypes =3D schema.getCompl= exTypeArray(); - for (int j =3D 0; j < complexTypes.length; j++= ) { - ComplexType complexType =3D complexTypes[j= ]; - String complexTypeName =3D complexType.get= Name(); - QName complexTypeQName =3D new QName(targe= tNamespace, complexTypeName); - complexTypeMap.put(complexTypeQName, compl= exType); - } - } catch (XmlException e) { - throw new DeploymentException("Invalid schema = in wsdl", e); - } - } else { - //problems?? - } - } - } - } - return complexTypeMap; - } - - private static final Map rpcHolderClasses =3D 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 =3D null; - if (mode =3D=3D ParameterDesc.IN) { - //IN parameters just use their own type - try { - paramJavaType =3D ClassLoading.loadClass(paramJavaTypeName= , classLoader); - } catch (ClassNotFoundException e) { - throw new DeploymentException("could not load parameter ty= pe", 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 + "Hold= er", with the initial character uppercased. - String namespace =3D typeQName.getNamespaceURI(); - String packageName =3D getPackageFromNamespace(namespace, = mapping); - StringBuffer buf =3D new StringBuffer(packageName.length()= + typeQName.getLocalPart().length() + 14); - buf.append(packageName).append(".holders.").append(typeQNa= me.getLocalPart()).append("Holder"); - buf.setCharAt(packageName.length() + 9, Character.toUpperC= ase(typeQName.getLocalPart().charAt(0))); - holderName =3D buf.toString(); - } else { - //see if it is in the primitive type and simple type mappi= ng - try { - paramJavaType =3D ClassLoading.loadClass(paramJavaType= Name, classLoader); - } catch (ClassNotFoundException e) { - throw new DeploymentException("could not load paramete= r type", e); - } - Class holder =3D (Class) rpcHolderClasses.get(paramJavaTyp= e); - if (holder !=3D 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 =3D paramJavaType.getName(); - StringBuffer buf =3D new StringBuffer(paramTypeName.length= () + 14); - int dot =3D paramTypeName.lastIndexOf("."); - //foo.Bar >>> foo.holders.BarHolder - buf.append(paramTypeName.substring(0, dot)).append(".holde= rs").append(paramTypeName.substring(dot)).append("Holder"); - holderName =3D buf.toString(); - } - try { - Class holder =3D ClassLoading.loadClass(holderName, classL= oader); - return holder; - } catch (ClassNotFoundException e) { - throw new DeploymentException("Could not load holder class= ", e); - } - } - } - - - private void saveClass(DeploymentContext deploymentContext, String cla= ssName, byte[] classBytes) throws DeploymentException { - try { - deploymentContext.addClass(ENHANCED_LOCATION, className, class= Bytes, true); - } catch (IOException e) { - throw new DeploymentException("Could not save enhanced class b= ytes", e); - } catch (URISyntaxException e) { - throw new DeploymentException("Could not construct URI for cla= ss file", e); - } - } =20 private static class ByteArrayRetrievingGeneratorStrategy extends Defa= ultGeneratorStrategy { =20 @@ -1063,53 +755,13 @@ } } =20 - static class JarWSDLLocator implements WSDLLocator { - - private final JarFile moduleFile; - private final URI wsdlURI; - private URI latestImportURI; - - public JarWSDLLocator(JarFile moduleFile, URI wsdlURI) { - this.moduleFile =3D moduleFile; - this.wsdlURI =3D wsdlURI; - } - - public InputSource getBaseInputSource() { - InputStream wsdlInputStream =3D null; - try { - wsdlInputStream =3D moduleFile.getInputStream(moduleFile.g= etEntry(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, Str= ing relativeLocation) { - URI parentURI =3D URI.create(parentLocation); - latestImportURI =3D parentURI.resolve(relativeLocation); - InputStream importInputStream =3D null; - try { - importInputStream =3D moduleFile.getInputStream(moduleFile= .getEntry(latestImportURI.toString())); - } catch (IOException e) { - throw new RuntimeException("Could not open stream to impor= t file", e); - } - return new InputSource(importInputStream); - } - - public String getLatestImportURI() { - return latestImportURI.toString(); - } - } =20 public static final GBeanInfo GBEAN_INFO; =20 static { GBeanInfoBuilder infoBuilder =3D new GBeanInfoBuilder(AxisBuilder.= class, NameFactory.MODULE_BUILDER); infoBuilder.addInterface(ServiceReferenceBuilder.class); + infoBuilder.addInterface(WebServiceBuilder.class); =20 GBEAN_INFO =3D infoBuilder.getBeanInfo(); } Added: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axi= s/builder/PortInfo.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/= java/org/apache/geronimo/axis/builder/PortInfo.java?view=3Dauto&rev=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/PortInfo.java (added) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/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 implie= d=2E + * 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 definitio= n, JavaWsdlMappingType javaWsdlMapping, String seiInterfaceName, PortCompon= entHandlerType[] handlers) { + this.portName =3D portName; + this.portQName =3D portQName; + this.definition =3D definition; + this.javaWsdlMapping =3D javaWsdlMapping; + this.seiInterfaceName =3D seiInterfaceName; + this.handlers =3D 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/axi= s/builder/WSDescriptorParser.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/= java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?view=3Dauto&r= ev=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/WSDescriptorParser.java (added) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/b= uilder/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 implie= d=2E + * 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 modul= eFile, boolean isEJB) throws DeploymentException { + try { + WebservicesDocument webservicesDocument =3D WebservicesDocumen= t=2EFactory.parse(wsDDUrl); + SchemaConversionUtils.validateDD(webservicesDocument); + WebservicesType webservicesType =3D webservicesDocument.getWeb= services(); + return parseWebServiceDescriptor(webservicesType, moduleFile, = isEJB); + } catch (XmlException e) { + throw new DeploymentException("Could not read descriptor docum= ent", e); + } catch (IOException e) { + return null; + } + + } + + public static Map parseWebServiceDescriptor(WebservicesType webservice= sType, JarFile moduleFile, boolean isEJB) throws DeploymentException { + Map portMap =3D new HashMap(); + WebserviceDescriptionType[] webserviceDescriptions =3D webservices= Type.getWebserviceDescriptionArray(); + for (int i =3D 0; i < webserviceDescriptions.length; i++) { + WebserviceDescriptionType webserviceDescription =3D webservice= Descriptions[i]; + URI wsdlURI =3D null; + try { + wsdlURI =3D new URI(webserviceDescription.getWsdlFile().ge= tStringValue().trim()); + } catch (URISyntaxException e) { + throw new DeploymentException("could not construct wsdl ur= i from " + webserviceDescription.getWsdlFile().getStringValue(), e); + } + URI jaxrpcMappingURI =3D null; + try { + jaxrpcMappingURI =3D new URI(webserviceDescription.getJaxr= pcMappingFile().getStringValue().trim()); + } catch (URISyntaxException e) { + throw new DeploymentException("Could not construct jaxrpc = mapping uri from " + webserviceDescription.getJaxrpcMappingFile(), e); + } + Definition definition =3D readWsdl(moduleFile, wsdlURI); + JavaWsdlMappingType javaWsdlMapping =3D readJaxrpcMapping(modu= leFile, jaxrpcMappingURI); + PortComponentType[] portComponents =3D webserviceDescription.g= etPortComponentArray(); + for (int j =3D 0; j < portComponents.length; j++) { + PortComponentType portComponent =3D portComponents[j]; + String portComponentName =3D portComponent.getPortComponen= tName().getStringValue().trim(); + QName portQName =3D portComponent.getWsdlPort().getQNameVa= lue(); + String seiInterfaceName =3D portComponent.getServiceEndpoi= ntInterface().getStringValue().trim(); + ServiceImplBeanType serviceImplBeanType =3D portComponent.= getServiceImplBean(); + if (isEJB =3D=3D serviceImplBeanType.isSetServletLink()) { + throw new DeploymentException("Wrong kind of web servi= ce described in web service descriptor: expected " + (isEJB? "EJB": "POJO(S= ervlet)")); + } + String linkName; + if (serviceImplBeanType.isSetServletLink()) { + linkName =3D serviceImplBeanType.getServletLink().getS= tringValue().trim(); + } else { + linkName =3D serviceImplBeanType.getEjbLink().getStrin= gValue().trim(); + } + PortComponentHandlerType[] handlers =3D portComponent.getH= andlerArray(); + PortInfo portInfo =3D new PortInfo(portComponentName, port= QName, definition, javaWsdlMapping, seiInterfaceName, handlers); + if (portMap.put(linkName, portInfo) !=3D null) { + throw new DeploymentException("Ambiguous description o= f port associated with j2ee component " + linkName); + } + } + } + return portMap; + } + + public static JavaWsdlMappingType readJaxrpcMapping(JarFile moduleFile= , URI jaxrpcMappingURI) throws DeploymentException { + JavaWsdlMappingType mapping; + InputStream jaxrpcInputStream =3D null; + try { + jaxrpcInputStream =3D moduleFile.getInputStream(moduleFile.get= Entry(jaxrpcMappingURI.toString())); + } catch (IOException e) { + throw new DeploymentException("Could not open stream to jaxrpc= mapping document", e); + } + JavaWsdlMappingDocument mappingDocument =3D null; + try { + mappingDocument =3D JavaWsdlMappingDocument.Factory.parse(jaxr= pcInputStream); + } catch (XmlException e) { + throw new DeploymentException("Could not parse jaxrpc mapping = document", e); + } catch (IOException e) { + throw new DeploymentException("Could not read jaxrpc mapping d= ocument", e); + } + mapping =3D mappingDocument.getJavaWsdlMapping(); + return mapping; + } + + public static Definition readWsdl(JarFile moduleFile, URI wsdlURI) thr= ows DeploymentException { + Definition definition; + JarWSDLLocator wsdlLocator =3D new JarWSDLLocator(moduleFile, wsdl= URI); + WSDLFactory wsdlFactory =3D null; + try { + wsdlFactory =3D WSDLFactory.newInstance(); + } catch (WSDLException e) { + throw new DeploymentException("Could not create WSDLFactory", = e); + } + WSDLReader wsdlReader =3D wsdlFactory.newWSDLReader(); + try { + definition =3D 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 definiti= ons' 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 =3D new HashMap(); + Types types =3D definition.getTypes(); + Map namespaceMap =3D definition.getNamespaces(); + if (types !=3D null) { + List schemas =3D types.getExtensibilityElements(); + for (Iterator iterator =3D schemas.iterator(); iterator.hasNex= t();) { + Object o =3D iterator.next(); + if (o instanceof Schema) { + Schema unknownExtensibilityElement =3D (Schema) o; + QName elementType =3D unknownExtensibilityElement.getE= lementType(); + if (new QName("http://www.w3.org/2001/XMLSchema", "sch= ema").equals(elementType)) { + Element element =3D unknownExtensibilityElement.ge= tElement(); + try { + XmlObject xmlObject =3D SchemaConversionUtils.= parse(element); + XmlCursor cursor =3D xmlObject.newCursor(); + try { + cursor.toFirstContentToken(); + for (Iterator namespaces =3D namespaceMap.= entrySet().iterator(); namespaces.hasNext();) { + Map.Entry entry =3D (Map.Entry) namesp= aces.next(); + cursor.insertNamespace((String) entry.= getKey(), (String) entry.getValue()); + } + } finally { + cursor.dispose(); + } + SchemaDocument schemaDoc =3D (SchemaDocument) = xmlObject.changeType(SchemaDocument.type); + SchemaConversionUtils.validateDD(schemaDoc); + SchemaDocument.Schema schema =3D schemaDoc.get= Schema(); + String targetNamespace =3D schema.getTargetNam= espace(); + ComplexType[] complexTypes =3D schema.getCompl= exTypeArray(); + for (int j =3D 0; j < complexTypes.length; j++= ) { + ComplexType complexType =3D complexTypes[j= ]; + String complexTypeName =3D complexType.get= Name(); + QName complexTypeQName =3D new QName(targe= tNamespace, complexTypeName); + complexTypeMap.put(complexTypeQName, compl= exType); + } + } 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-RC= 3=2Ejar 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 unknownExtensibilityElemen= t =3D (UnknownExtensibilityElement) o; + QName elementType =3D unknownExtensibilityElement.getE= lementType(); + if (new QName("http://www.w3.org/2001/XMLSchema", "sch= ema").equals(elementType)) { + Element element =3D unknownExtensibilityElement.ge= tElement(); + try { + XmlObject xmlObject =3D SchemaConversionUtils.= parse(element); + XmlCursor cursor =3D xmlObject.newCursor(); + try { + cursor.toFirstContentToken(); + for (Iterator namespaces =3D namespaceMap.= entrySet().iterator(); namespaces.hasNext();) { + Map.Entry entry =3D (Map.Entry) namesp= aces.next(); + cursor.insertNamespace((String) entry.= getKey(), (String) entry.getValue()); + } + } finally { + cursor.dispose(); + } + SchemaDocument schemaDoc =3D (SchemaDocument) = xmlObject.changeType(SchemaDocument.type); + SchemaConversionUtils.validateDD(schemaDoc); + SchemaDocument.Schema schema =3D schemaDoc.get= Schema(); + String targetNamespace =3D schema.getTargetNam= espace(); + ComplexType[] complexTypes =3D schema.getCompl= exTypeArray(); + for (int j =3D 0; j < complexTypes.length; j++= ) { + ComplexType complexType =3D complexTypes[j= ]; + String complexTypeName =3D complexType.get= Name(); + QName complexTypeQName =3D new QName(targe= tNamespace, complexTypeName); + complexTypeMap.put(complexTypeQName, compl= exType); + } + } catch (XmlException e) { + throw new DeploymentException("Invalid schema = in wsdl", e); + } + } else { + //problems?? + } + } + } + } + return complexTypeMap; + } + + public static Map getExceptionMap(JavaWsdlMappingType mapping) { + Map exceptionMap =3D new HashMap(); + if (mapping !=3D null) { + ExceptionMappingType[] exceptionMappings =3D mapping.getExcept= ionMappingArray(); + for (int i =3D 0; i < exceptionMappings.length; i++) { + ExceptionMappingType exceptionMapping =3D exceptionMapping= s[i]; + QName exceptionMessageQName =3D exceptionMapping.getWsdlMe= ssage().getQNameValue(); + exceptionMap.put(exceptionMessageQName, exceptionMapping); + } + } + return exceptionMap; + } + + public static String getPackageFromNamespace(String namespace, JavaWsd= lMappingType mapping) throws DeploymentException { + PackageMappingType[] packageMappings =3D mapping.getPackageMapping= Array(); + for (int i =3D 0; i < packageMappings.length; i++) { + PackageMappingType packageMapping =3D packageMappings[i]; + if (namespace.equals(packageMapping.getNamespaceURI().getStrin= gValue().trim())) { + return packageMapping.getPackageType().getStringValue().tr= im(); + } + } + throw new DeploymentException("Namespace " + namespace + " was not= mapped in jaxrpc mapping file"); + } + + private static final Map rpcHolderClasses =3D 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 is= InOnly, QName typeQName, boolean isComplexType, JavaWsdlMappingType mapping= , ClassLoader classLoader) throws DeploymentException { + Class paramJavaType =3D null; + if (isInOnly) { + //IN parameters just use their own type + try { + paramJavaType =3D ClassLoading.loadClass(paramJavaTypeName= , classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("could not load parameter ty= pe", 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 + "Hold= er", with the initial character uppercased. + String namespace =3D typeQName.getNamespaceURI(); + String packageName =3D WSDescriptorParser.getPackageFromNa= mespace(namespace, mapping); + StringBuffer buf =3D new StringBuffer(packageName.length()= + typeQName.getLocalPart().length() + 14); + buf.append(packageName).append(".holders.").append(typeQNa= me.getLocalPart()).append("Holder"); + buf.setCharAt(packageName.length() + 9, Character.toUpperC= ase(typeQName.getLocalPart().charAt(0))); + holderName =3D buf.toString(); + } else { + //see if it is in the primitive type and simple type mappi= ng + try { + paramJavaType =3D ClassLoading.loadClass(paramJavaType= Name, classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("could not load paramete= r type", e); + } + Class holder =3D (Class) rpcHolderClasses.get(paramJavaTyp= e); + if (holder !=3D 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 =3D paramJavaType.getName(); + StringBuffer buf =3D new StringBuffer(paramTypeName.length= () + 14); + int dot =3D paramTypeName.lastIndexOf("."); + //foo.Bar >>> foo.holders.BarHolder + buf.append(paramTypeName.substring(0, dot)).append(".holde= rs").append(paramTypeName.substring(dot)).append("Holder"); + holderName =3D buf.toString(); + } + try { + Class holder =3D ClassLoading.loadClass(holderName, classL= oader); + return holder; + } catch (ClassNotFoundException e) { + throw new DeploymentException("Could not load holder class= ", e); + } + } + } + + public static ServiceEndpointMethodMappingType getMethodMappingForOper= ation(String operationName, ServiceEndpointMethodMappingType[] methodMappin= gs) throws DeploymentException { + for (int i =3D 0; i < methodMappings.length; i++) { + ServiceEndpointMethodMappingType methodMapping =3D methodMappi= ngs[i]; + if (operationName.equals(methodMapping.getWsdlOperation().getS= tringValue())) { + return methodMapping; + } + } + throw new DeploymentException("No method found for operation named= " + operationName); + } + + public static ServiceEndpointInterfaceMappingType getServiceEndpointIn= terfaceMapping(ServiceEndpointInterfaceMappingType[] endpointMappings, QNam= e portTypeQName) throws DeploymentException { + for (int i =3D 0; i < endpointMappings.length; i++) { + ServiceEndpointInterfaceMappingType endpointMapping =3D endpoi= ntMappings[i]; + QName testPortQName =3D endpointMapping.getWsdlPortType().getQ= NameValue(); + if (portTypeQName.equals(testPortQName)) { + return endpointMapping; + } + } + throw new DeploymentException("Could not find service endpoint int= erface for port named " + portTypeQName); + } + + public static ExtensibilityElement getExtensibilityElement(Class clazz= , List extensibilityElements) throws DeploymentException { + for (Iterator iterator =3D extensibilityElements.iterator(); itera= tor.hasNext();) { + ExtensibilityElement extensibilityElement =3D (ExtensibilityEl= ement) iterator.next(); + if (clazz.isAssignableFrom(extensibilityElement.getClass())) { + return extensibilityElement; + } + } + throw new DeploymentException("No element of class " + clazz.getNa= me() + " 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 =3D moduleFile; + this.wsdlURI =3D wsdlURI; + } + + public InputSource getBaseInputSource() { + InputStream wsdlInputStream =3D null; + try { + wsdlInputStream =3D moduleFile.getInputStream(moduleFile.g= etEntry(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, Str= ing relativeLocation) { + URI parentURI =3D URI.create(parentLocation); + latestImportURI =3D parentURI.resolve(relativeLocation); + InputStream importInputStream =3D null; + try { + importInputStream =3D moduleFile.getInputStream(moduleFile= .getEntry(latestImportURI.toString())); + } catch (IOException e) { + throw new RuntimeException("Could not open stream to impor= t 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=3Ddiff= &r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/b= uilder/ServiceReferenceTest.java (original) +++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/b= uilder/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; =20 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); } =20 - public void testServiceRefCreation() throws Exception { - AxisBuilder builder =3D new AxisBuilder(); - - ServiceReference ref =3D builder.createServiceReference(MockServic= e=2Eclass, null, null, null, null, null, context, isolatedCl); - Object instance =3D ref.getContent(); - assertTrue(instance instanceof Service); - - ClassLoader cl =3D context.getClassLoader(null); - Class loadedType =3D cl.loadClass(instance.getClass().getName()); - assertTrue(Service.class.isAssignableFrom(loadedType)); - assertTrue(instance.getClass() !=3D loadedType); - } - public void testServiceProxy() throws Exception { //construct the SEI proxy Map portMap =3D new HashMap(); @@ -263,8 +248,7 @@ WSDLFactory factory =3D WSDLFactory.newInstance(); WSDLReader reader =3D factory.newWSDLReader(); Definition definition =3D reader.readWSDL(wsdlFile.toURI().toStrin= g()); - AxisBuilder builder =3D new AxisBuilder(); - Map complexTypeMap =3D builder.getComplexTypesInWsdl(definition); + Map complexTypeMap =3D WSDescriptorParser.getComplexTypesInWsdl(de= finition); assertEquals(7, complexTypeMap.size()); } =20 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=3Ddiff&r1=3D15= 4622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/WebModule.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/WebModule.java Sun Feb 20 20:43:02 2005 @@ -18,6 +18,7 @@ =20 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 @@ =20 private final LinkedHashSet webClassPath =3D new LinkedHashSet(); private String contextRoot; + private final Map portMap; =20 - public WebModule(boolean standAlone, URI configId, URI parentId, JarFi= le moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, Str= ing originalSpecDD) { + public WebModule(boolean standAlone, URI configId, URI parentId, JarFi= le moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, Str= ing originalSpecDD, Map portMap) { super(standAlone, configId, parentId, moduleFile, targetPath, spec= DD, vendorDD, originalSpecDD); + this.portMap =3D portMap; } =20 public String getContextRoot() { @@ -48,6 +51,10 @@ =20 public ConfigurationModuleType getType() { return ConfigurationModuleType.WAR; + } + + public Map getPortMap() { + return portMap; } =20 public void addClass(URI location, String fqcn, byte[] bytes, Deployme= ntContext context) throws IOException, URISyntaxException { Added: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2e= e/deployment/WebServiceBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/= java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?view=3Dauto= &rev=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/WebServiceBuilder.java (added) +++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/d= eployment/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 implie= d=2E + * 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 adapte= d to holding a ws stack that talks to a + * POJO web service. The web deployer is responsible for filling in t= he standard servlet info such as init params. + * @param targetGBean + * @param portInfo + * @param seiClassName + * @throws DeploymentException + */ + void configurePOJO(GBeanData targetGBean, Object portInfo, String seiC= lassName) 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 some= thing 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=3Dd= iff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/EARConfigBuilderTest.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/EARConfigBuilderTest.java Sun Feb 20 20:43:02 2005 @@ -75,6 +75,7 @@ private static final ObjectName transactionalTimerObjectName =3D JMXUt= il.getObjectName(j2eeServerName + ":type=3DThreadPooledTimer,name=3DTransac= tionalThreaPooledTimer"); private static final ObjectName nonTransactionalTimerObjectName =3D JM= XUtil.getObjectName(j2eeServerName + ":type=3DThreadPooledTimer,name=3DNonT= ransactionalThreaPooledTimer"); private URI defaultParentId; + private static final Map portMap =3D null; =20 protected void setUp() throws Exception { defaultParentId =3D new URI("org/apache/geronimo/Server"); @@ -87,7 +88,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-ear14/test-ear.ear")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -104,7 +105,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-ear14/test-naked-ear.ear")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -121,7 +122,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-ear13/test-ear.ear")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -138,7 +139,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-ear13/test-naked-ear.ear")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -155,7 +156,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-unpacked-ear/full/")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -172,7 +173,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-unpacked-ear/naked/")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -189,7 +190,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-unpacked-ear/alt-dd/")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(false, null, null, null, "test-rar.rar", null, null, null); } @@ -206,7 +207,7 @@ earFile =3D DeploymentUtil.createJarFile(new File(basedir,= "target/test-unpacked-ear/alt-dd.ear")); ejbConfigBuilder.ejbModule =3D new EJBModule(false, null, = null, null, "test-ejb-jar.jar/", null, null, null); webConfigBuilder.contextRoot =3D "test"; - webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null); + webConfigBuilder.webModule =3D new WebModule(false, null, = null, null, "test-war.war/", null, null, null, portMap); webConfigBuilder.webModule.setContextRoot("test"); connectorConfigBuilder.connectorModule =3D new ConnectorMo= dule(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=3Dd= iff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/MockWARConfigBuilder.java (original) +++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/d= eployment/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; =20 import javax.management.ObjectName; =20 @@ -34,13 +35,14 @@ public WebModule webModule; public ClassLoader cl; public String contextRoot; + private Map portMap =3D null; =20 public Module createModule(File plan, JarFile moduleFile) throws Deplo= ymentException { - return new WebModule(true, null, null, moduleFile, "war", null, nu= ll, null); + return new WebModule(true, null, null, moduleFile, "war", null, nu= ll, null, portMap); } =20 public Module createModule(Object plan, JarFile moduleFile, String tar= getPath, URL specDDUrl, URI earConfigId) throws DeploymentException { - return new WebModule(false, null, null, moduleFile, targetPath, nu= ll, null, null); + return new WebModule(false, null, null, moduleFile, targetPath, nu= ll, null, null, portMap); } =20 public void installModule(JarFile earFile, EARContext earContext, Modu= le 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=3Ddiff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2e= eobjectnames/NameFactory.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org= /apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?view=3Ddiff&r1=3D154= 622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjec= tnames/NameFactory.java (original) +++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjec= tnames/NameFactory.java Sun Feb 20 20:43:02 2005 @@ -95,6 +95,7 @@ public static final String PERSISTENT_CONFIGURATION_LIST =3D "Persiste= ntConfigurationList"; //duplicated in FileConfigurationList // public static final String URL_PATTERN =3D "URLPattern"; public static String DEFAULT_SERVLET =3D "DefaultServlet"; + public static final String SERVLET_WEB_SERVICE_TEMPLATE =3D "ServletWe= bServiceTemplate"; =20 public static ObjectName getDomainName(String j2eeDomainName, J2eeCont= ext context) throws MalformedObjectNameException { Properties props =3D new Properties(); Modified: geronimo/trunk/modules/jetty-builder/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/pro= ject.xml?view=3Ddiff&r1=3D154622&r2=3D154623 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- geronimo/trunk/modules/jetty-builder/project.xml (original) +++ geronimo/trunk/modules/jetty-builder/project.xml Sun Feb 20 20:43:02 20= 05 @@ -172,6 +172,13 @@ ${pom.currentVersion} =20 + + + geronimo + geronimo-axis-builder + ${pom.currentVersion} + + geronimo-spec geronimo-spec-jta @@ -231,6 +238,18 @@ =20 + geronimo-spec + geronimo-spec-jaxrpc + ${geronimo_spec_jaxrpc_version} + + + + geronimo-spec + geronimo-spec-saaj + ${geronimo_spec_saaj_version} + + + commons-logging commons-logging ${commons_logging_version} @@ -294,6 +313,13 @@ ${tranql_version} http://tranql.codehaus.org + + + axis + axis-wsdl4j + ${axis_wsdl4j_version} + + =20 =20