You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by di...@apache.org on 2007/02/26 21:18:34 UTC
svn commit: r511987 - in /geronimo/server/trunk:
assemblies/geronimo-jetty6-jee5/src/main/var/config/
assemblies/geronimo-tomcat6-jee5/src/main/var/config/
configs/axis2-deployer/src/plan/ configs/axis2/
configs/openejb-deployer/src/plan/ modules/geron...
Author: dims
Date: Mon Feb 26 12:18:33 2007
New Revision: 511987
URL: http://svn.apache.org/viewvc?view=rev&rev=511987
Log:
Fix for GERONIMO-2876 - Initial web service EJB support for Axis2
Added:
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/EJBWebServiceGBean.java
Removed:
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java
Modified:
geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
geronimo/server/trunk/configs/axis2-deployer/src/plan/plan.xml
geronimo/server/trunk/configs/axis2/pom.xml
geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
geronimo/server/trunk/modules/geronimo-axis2/pom.xml
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
Modified: geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/var/config/config.xml Mon Feb 26 12:18:33 2007
@@ -157,11 +157,21 @@
<module name="org.apache.geronimo.configs/axis2-deployer/${version}/car"
condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2'">
- <!-- this gbean is not yet written -->
- <!--<gbean name="Axis2ServiceRefBuilder">
- <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
- </gbean>-->
- </module>
+
+ <gbean name="Axis2ModuleBuilderExtension">
+ <attribute name="listener">?name=JettyWebContainer</attribute>
+ <attribute name="defaultEnvironment">
+ <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>jetty6</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ </attribute>
+ </gbean> </module>
<module name="org.apache.geronimo.configs/cxf-deployer/${version}/car"
condition="props.getProperty('org.apache.geronimo.jaxws.provider', 'cxf') == 'cxf'">
Modified: geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/var/config/config.xml Mon Feb 26 12:18:33 2007
@@ -164,10 +164,21 @@
<module name="org.apache.geronimo.configs/axis2-deployer/${version}/car"
condition="props.getProperty('org.apache.geronimo.jaxws.provider', 'axis2') == 'axis2'">
- <!-- this gbean is not yet written -->
- <!--<gbean name="Axis2ServiceRefBuilder">
- <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
- </gbean>-->
+
+ <gbean name="Axis2ModuleBuilderExtension">
+ <attribute name="listener">?name=TomcatWebContainer</attribute>
+ <attribute name="defaultEnvironment">
+ <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>tomcat6</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ </attribute>
+ </gbean>
</module>
<module name="org.apache.geronimo.configs/cxf-deployer/${version}/car"
Modified: geronimo/server/trunk/configs/axis2-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis2-deployer/src/plan/plan.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/configs/axis2-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/axis2-deployer/src/plan/plan.xml Mon Feb 26 12:18:33 2007
@@ -1,74 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- $Rev: 482336 $ $Date: 2006-12-04 15:12:19 -0500 (Mon, 04 Dec 2006) $ -->
-
-<module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
-
- <gbean name="Axis2Builder" class="org.apache.geronimo.axis2.builder.Axis2Builder">
- <xml-attribute name="defaultEnvironment">
- <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>axis2</artifactId>
- <type>car</type>
- </dependency>
- </dependencies>
- </environment>
- </xml-attribute>
- </gbean>
-
- <gbean name="Axis2ServiceRefBuilder" class="org.apache.geronimo.axis2.builder.Axis2ServiceRefBuilder">
- <attribute name="eeNamespaces">http://java.sun.com/xml/ns/javaee</attribute>
- <xml-attribute name="defaultEnvironment">
- <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>axis2</artifactId>
- <type>car</type>
- </dependency>
- </dependencies>
- </environment>
- </xml-attribute>
- <reference name="Axis2Builder">
- <name>Axis2Builder</name>
- </reference>
- </gbean>
-
- <gbean name="Axis2ClientServiceRefBuilder" class="org.apache.geronimo.axis2.builder.Axis2ServiceRefBuilder">
- <attribute name="eeNamespaces">http://java.sun.com/xml/ns/javaee</attribute>
- <xml-attribute name="defaultEnvironment">
- <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-axis2</artifactId>
- <type>jar</type>
- </dependency>
- </dependencies>
- </environment>
- </xml-attribute>
- <reference name="Axis2Builder">
- <name>Axis2Builder</name>
- </reference>
- </gbean>
-
-
-</module>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Rev: 482336 $ $Date: 2006-12-04 15:12:19 -0500 (Mon, 04 Dec 2006) $ -->
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
+
+ <gbean name="Axis2Builder" class="org.apache.geronimo.axis2.builder.Axis2Builder">
+ <xml-attribute name="defaultEnvironment">
+ <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>axis2</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ </xml-attribute>
+ </gbean>
+
+ <gbean name="Axis2ServiceRefBuilder" class="org.apache.geronimo.axis2.builder.Axis2ServiceRefBuilder">
+ <attribute name="eeNamespaces">http://java.sun.com/xml/ns/javaee</attribute>
+ <xml-attribute name="defaultEnvironment">
+ <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>axis2</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ </xml-attribute>
+ <reference name="Axis2Builder">
+ <name>Axis2Builder</name>
+ </reference>
+ </gbean>
+
+ <gbean name="Axis2ClientServiceRefBuilder" class="org.apache.geronimo.axis2.builder.Axis2ServiceRefBuilder">
+ <attribute name="eeNamespaces">http://java.sun.com/xml/ns/javaee</attribute>
+ <xml-attribute name="defaultEnvironment">
+ <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-axis2</artifactId>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ </xml-attribute>
+ <reference name="Axis2Builder">
+ <name>Axis2Builder</name>
+ </reference>
+ </gbean>
+
+ <gbean name="Axis2ModuleBuilderExtension" class="org.apache.geronimo.jaxws.builder.JAXWSEJBModuleBuilderExtension">
+ <!-- These two attributes must be updated appropriately in the config.xml file -->
+ <attribute name="listener">?name=WebContainer</attribute>
+
+ <reference name="WebServiceBuilder">
+ <name>Axis2Builder</name>
+ </reference>
+ <reference name="WebServiceLinkTemplate">
+ <name>Axis2WebServiceEJBLinkTemplate</name>
+ </reference>
+ </gbean>
+
+ <gbean name="Axis2WebServiceEJBLinkTemplate" class="org.apache.geronimo.axis2.EJBWebServiceGBean"/>
+
+</module>
Modified: geronimo/server/trunk/configs/axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis2/pom.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/configs/axis2/pom.xml (original)
+++ geronimo/server/trunk/configs/axis2/pom.xml Mon Feb 26 12:18:33 2007
@@ -44,6 +44,13 @@
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>openejb</artifactId>
+ <version>${version}</version>
+ <type>car</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
<artifactId>webservices-common</artifactId>
<type>car</type>
<version>${version}</version>
@@ -171,8 +178,8 @@
<artifactId>annogen</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
Modified: geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Mon Feb 26 12:18:33 2007
@@ -28,6 +28,9 @@
<pattern>
<name>CXFModuleBuilderExtension</name>
</pattern>
+ <pattern>
+ <name>Axis2ModuleBuilderExtension</name>
+ </pattern>
</references>
<reference name="SecurityBuilders">
<name>SecurityBuilder</name>
Modified: geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java Mon Feb 26 12:18:33 2007
@@ -17,6 +17,24 @@
package org.apache.geronimo.axis2.builder;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.JarFile;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import javax.xml.transform.stream.StreamSource;
+
import org.apache.axis2.jaxws.javaee.HandlerChainsType;
import org.apache.axis2.jaxws.javaee.PortComponentType;
import org.apache.axis2.jaxws.javaee.ServiceImplBeanType;
@@ -28,8 +46,6 @@
import org.apache.geronimo.axis2.client.Axis2ServiceReference;
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
-import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -41,37 +57,14 @@
import org.apache.geronimo.jaxws.builder.EndpointInfoBuilder;
import org.apache.geronimo.jaxws.builder.JAXWSServiceBuilder;
import org.apache.geronimo.jaxws.client.EndpointInfo;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
import org.apache.geronimo.xbeans.javaee.ServiceRefHandlerChainsType;
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.URI;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.jar.JarFile;
-
public class Axis2Builder extends JAXWSServiceBuilder {
private static final Log log = LogFactory.getLog(Axis2Builder.class);
- private Definition wsdlDefinition = null;
-
public Axis2Builder(Environment defaultEnviroment) {
super(defaultEnviroment);
}
@@ -120,28 +113,7 @@
for (PortComponentType port : desc.getPortComponent()) {
- org.apache.geronimo.axis2.PortInfo portInfo = new org.apache.geronimo.axis2.PortInfo();
-
- if(wsdlFile != null && !wsdlFile.equals("")){
- URL wsdlURL = DeploymentUtil.createJarURL(moduleFile, wsdlFile);
- InputStream wsdlStream = wsdlURL.openStream();
- if(wsdlStream == null){
- throw new DeploymentException("unable to read descriptor "+wsdlURL);
- }else {
- try {
- WSDLFactory factory = WSDLFactory.newInstance();
- WSDLReader reader = factory.newWSDLReader();
- reader.setFeature("javax.wsdl.importDocuments", true);
- reader.setFeature("javax.wsdl.verbose", false);
- wsdlDefinition = reader.readWSDL(wsdlURL.toString());
- portInfo.setWsdlDefinition(wsdlDefinition);
- wsdlStream.close();
- } catch (RuntimeException e) {
- throw new DeploymentException("invalid WSDL provided "+wsdlURL);
- }
- }
- }
-
+ PortInfo portInfo = new PortInfo();
String serviceLink = null;
ServiceImplBeanType beanType = port.getServiceImplBean();
if (beanType.getEjbLink() != null) {
@@ -224,7 +196,7 @@
Map portInfoMap = (Map) sharedContext.get(getKey());
if(portInfoMap != null && portInfoMap.get(servletName) != null){
- org.apache.geronimo.jaxws.PortInfo portInfo = (org.apache.geronimo.jaxws.PortInfo) portInfoMap.get(servletName);
+ PortInfo portInfo = (PortInfo) portInfoMap.get(servletName);
processURLPattern(contextRoot, portInfo);
}
@@ -283,7 +255,7 @@
return in;
}
- private void processURLPattern(String contextRoot, org.apache.geronimo.jaxws.PortInfo portInfo) throws DeploymentException {
+ private void processURLPattern(String contextRoot, PortInfo portInfo) throws DeploymentException {
//if the user specifies a url-pattern, set it here.
String oldup = portInfo.getLocation();
if (oldup == null || oldup.length() == 0) {
Modified: geronimo/server/trunk/modules/geronimo-axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/pom.xml?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/pom.xml Mon Feb 26 12:18:33 2007
@@ -43,6 +43,11 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-openejb</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-transaction</artifactId>
<version>${version}</version>
</dependency>
@@ -51,128 +56,126 @@
<artifactId>geronimo-jaxws</artifactId>
<version>${version}</version>
</dependency>
-
<!-- Had to add due to the Axis2WebServiceContainerTest -->
<dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <version>2.0.2</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.0.2</version>
- <exclusions>
- <exclusion>
- <artifactId>jsr173</artifactId>
- <groupId>javax.xml</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-java2wsdl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-jaxws-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-metadata</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons</groupId>
- <artifactId>XmlSchema</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.neethi</groupId>
- <artifactId>neethi</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </dependency>
- <dependency>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </dependency>
- <dependency>
- <groupId>annogen</groupId>
- <artifactId>annogen</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>2.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.0.2</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>jsr173</artifactId>
+ <groupId>javax.xml</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-java2wsdl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-adb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-jaxws-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-metadata</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons</groupId>
+ <artifactId>XmlSchema</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.neethi</groupId>
+ <artifactId>neethi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>annogen</groupId>
+ <artifactId>annogen</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
</dependencies>
-
<build>
<plugins>
<plugin>
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java Mon Feb 26 12:18:33 2007
@@ -70,6 +70,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
import org.apache.geronimo.jaxws.JNDIResolver;
+import org.apache.geronimo.jaxws.PortInfo;
import org.apache.geronimo.jaxws.ServerJNDIResolver;
import org.apache.geronimo.jaxws.annotations.AnnotationException;
import org.apache.geronimo.webservices.WebServiceContainer;
@@ -85,7 +86,7 @@
private transient final ClassLoader classLoader;
private final String endpointClassName;
- private final PortInfo portInfo;
+ private final org.apache.geronimo.jaxws.PortInfo portInfo;
private ConfigurationContext configurationContext;
private String contextRoot = null;
private Map servicesMap;
@@ -94,6 +95,7 @@
private Object endpointInstance;
private List<Handler> chain;
private AxisService service;
+ private URL configurationBaseUrl;
public Axis2WebServiceContainer(PortInfo portInfo,
String endpointClassName,
@@ -103,13 +105,14 @@
this.classLoader = classLoader;
this.endpointClassName = endpointClassName;
this.portInfo = portInfo;
+ this.configurationBaseUrl = configurationBaseUrl;
try {
configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
configurationContext.setServicePath(portInfo.getLocation());
- if(portInfo.getWsdlDefinition() != null){ //WSDL Has been provided
+ if(portInfo.getWsdlFile() != null && !portInfo.getWsdlFile().equals("")){ //WSDL file Has been provided
AxisServiceGenerator serviceGen = new AxisServiceGenerator();
- service = serviceGen.getServiceFromWSDL(portInfo, endpointClassName, classLoader);
+ service = serviceGen.getServiceFromWSDL(portInfo, endpointClassName, configurationBaseUrl, classLoader);
}else { //No WSDL, Axis2 will handle it. Is it ?
service = AxisService.createService(endpointClassName, configurationContext.getAxisConfiguration(), JAXWSMessageReceiver.class);
@@ -124,7 +127,7 @@
throw new RuntimeException(e);
}
jndiResolver = new ServerJNDIResolver(context);
- }
+ }
public void getWsdl(Request request, Response response) throws Exception {
doService(request, response);
@@ -303,11 +306,14 @@
}
}
if (uri.getQuery().startsWith("wsdl")) {
- if(portInfo.getWsdlDefinition() != null){
- WSDLFactory factory = WSDLFactory.newInstance();
- WSDLWriter writer = factory.newWSDLWriter();
- writer.writeWSDL(portInfo.getWsdlDefinition(), response.getOutputStream());
- return;
+ if (portInfo.getWsdlFile() != null && !portInfo.getWsdlFile().equals("")) { //wsdl file has been provided
+ Definition wsdlDefinition = new AxisServiceGenerator().getWSDLDefition(portInfo, configurationBaseUrl, classLoader);
+ if(wsdlDefinition != null){
+ WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLWriter writer = factory.newWSDLWriter();
+ writer.writeWSDL(wsdlDefinition, response.getOutputStream());
+ return;
+ }
}else {
service.printWSDL(response.getOutputStream());
return;
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java Mon Feb 26 12:18:33 2007
@@ -39,12 +39,12 @@
private static final Log log = LogFactory.getLog(Axis2WebServiceContainerFactoryGBean.class);
private final ClassLoader classLoader;
- private final org.apache.geronimo.axis2.PortInfo portInfo;
+ private final org.apache.geronimo.jaxws.PortInfo portInfo;
private final String endpointClassName;
private URL configurationBaseUrl;
private Context context;
- public Axis2WebServiceContainerFactoryGBean(org.apache.geronimo.axis2.PortInfo portInfo,
+ public Axis2WebServiceContainerFactoryGBean(org.apache.geronimo.jaxws.PortInfo portInfo,
String endpointClassName,
ClassLoader classLoader,
Map componentContext,
@@ -78,7 +78,7 @@
static {
GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(Axis2WebServiceContainerFactoryGBean.class, NameFactory.GERONIMO_SERVICE);
- infoBuilder.addAttribute("portInfo", org.apache.geronimo.axis2.PortInfo.class, true, true);
+ infoBuilder.addAttribute("portInfo", org.apache.geronimo.jaxws.PortInfo.class, true, true);
infoBuilder.addAttribute("endpointClassName", String.class, true, true);
infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
infoBuilder.addAttribute("componentContext", Map.class, true, true);
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java Mon Feb 26 12:18:33 2007
@@ -18,9 +18,13 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.io.StringReader;
import java.lang.reflect.Method;
+import java.net.MalformedURLException;
import java.net.URI;
+import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -29,7 +33,9 @@
import javax.wsdl.Definition;
import javax.wsdl.Port;
import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
import javax.wsdl.xml.WSDLWriter;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException;
@@ -61,9 +67,9 @@
import org.apache.axis2.util.XMLUtils;
import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.axis2.wsdl.WSDLUtil;
+import org.apache.geronimo.jaxws.PortInfo;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaObject;
import org.apache.ws.commons.schema.XmlSchemaParticle;
import org.apache.ws.commons.schema.XmlSchemaSequence;
import org.apache.ws.commons.schema.XmlSchemaType;
@@ -81,12 +87,12 @@
super();
}
- public AxisService getServiceFromWSDL(PortInfo portInfo, String endpointClassName, ClassLoader classLoader) throws Exception {
+ public AxisService getServiceFromWSDL(PortInfo portInfo, String endpointClassName, URL configurationBaseUrl, ClassLoader classLoader) throws Exception {
WSDLToAxisServiceBuilder wsdlBuilder = null;
WSDLFactory factory = WSDLFactory.newInstance();
WSDLWriter writer = factory.newWSDLWriter();
+ Definition wsdlDefinition = getWSDLDefition(portInfo, configurationBaseUrl, classLoader);
- Definition wsdlDefinition = portInfo.getWsdlDefinition();
ByteArrayOutputStream out = new ByteArrayOutputStream();
writer.writeWSDL(wsdlDefinition, out);
String wsdlContent = out.toString(WSDL_ENCODING); //Will the Axis2 give us this information soon ?
@@ -129,17 +135,17 @@
Class endPointClass = classLoader.loadClass(endpointClassName);
Method[] classMethods = endPointClass.getMethods();
- for (Iterator<AxisOperation> opIterator = service.getOperations(); opIterator.hasNext();) {
- AxisOperation operation = opIterator.next();
- operation.setMessageReceiver(JAXWSMessageReceiver.class.newInstance());
-
- for (Method method : classMethods) {
- String axisOpName = operation.getName().getLocalPart();
- if (method.getName().equals(axisOpName)) {
- fillOperationInformation(method, operation, dbc);
- }
- }
- }
+ for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext() ;){
+ AxisOperation operation = opIterator.next();
+ operation.setMessageReceiver(JAXWSMessageReceiver.class.newInstance());
+
+ for(Method method : classMethods){
+ String axisOpName = operation.getName().getLocalPart();
+ if(method.getName().equals(axisOpName)){
+ fillOperationInformation(method, operation, dbc);
+ }
+ }
+ }
dbc.setWebServiceAnnot(serviceAnnot);
dbc.setWsdlDefinition(wsdlDefinition);
@@ -155,56 +161,56 @@
}
private void fillOperationInformation(Method method, AxisOperation operation, DescriptionBuilderComposite dbc) throws Exception{
- MethodDescriptionComposite mdc = new MethodDescriptionComposite();
- WebMethodAnnot webMethodAnnot = WebMethodAnnot.createWebMethodAnnotImpl();
- webMethodAnnot.setOperationName(method.getName());
-
- if(operation.getStyle().equals(AxisOperation.STYLE_DOC)){
- fillDocOperationInfo(method, operation, dbc, mdc, webMethodAnnot);
- }else if(operation.getStyle().equals(AxisOperation.STYLE_RPC)){
- throw new RuntimeException("Not Yet Implemented");
- }
+ MethodDescriptionComposite mdc = new MethodDescriptionComposite();
+ WebMethodAnnot webMethodAnnot = WebMethodAnnot.createWebMethodAnnotImpl();
+ webMethodAnnot.setOperationName(method.getName());
+
+ if(operation.getStyle().equals(AxisOperation.STYLE_DOC)){
+ fillDocOperationInfo(method, operation, dbc, mdc, webMethodAnnot);
+ }else if(operation.getStyle().equals(AxisOperation.STYLE_RPC)){
+ throw new RuntimeException("Not Yet Implemented");
+ }
}
private void fillDocOperationInfo(Method method, AxisOperation operation, DescriptionBuilderComposite dbc, MethodDescriptionComposite mdc, WebMethodAnnot webMethodAnnot ) throws Exception{
mdc.setWebMethodAnnot(webMethodAnnot);
mdc.setMethodName(method.getName());
- String MEP = operation.getMessageExchangePattern();
+ String MEP = operation.getMessageExchangePattern();
- if (WSDLUtil.isInputPresentForMEP(MEP)) {
- AxisMessage inAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
- if(inAxisMessage != null){
+ if (WSDLUtil.isInputPresentForMEP(MEP)) {
+ AxisMessage inAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ if(inAxisMessage != null){
- XmlSchemaElement element = inAxisMessage.getSchemaElement();
- XmlSchemaType schemaType = element.getSchemaType();
+ XmlSchemaElement element = inAxisMessage.getSchemaElement();
+ XmlSchemaType schemaType = element.getSchemaType();
- if(schemaType instanceof XmlSchemaComplexType){
+ if(schemaType instanceof XmlSchemaComplexType){
- XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
- XmlSchemaParticle particle = complexSchemaType.getParticle();
+ XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
+ XmlSchemaParticle particle = complexSchemaType.getParticle();
// TODO: What if we have more than one complex type in a sequence ???
- if (particle instanceof XmlSchemaSequence) {
- XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
- Iterator iterator = xmlSchemaSequence.getItems().getIterator();
+ if (particle instanceof XmlSchemaSequence) {
+ XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
+ Iterator iterator = xmlSchemaSequence.getItems().getIterator();
- while (iterator.hasNext()) {
- XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
- XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
+ while (iterator.hasNext()) {
+ XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
+ XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
- if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
- element = innerElement;
- break;
- }else {
- XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
- XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
- XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
- iterator = innerXmlSchemaSequence.getItems().getIterator();
- }
- }
- }
- }
+ if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
+ element = innerElement;
+ break;
+ }else {
+ XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
+ XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
+ XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
+ iterator = innerXmlSchemaSequence.getItems().getIterator();
+ }
+ }
+ }
+ }
ParameterDescriptionComposite pdc = new ParameterDescriptionComposite();
WebParamAnnot webParamAnnot = WebParamAnnot.createWebParamAnnotImpl();
@@ -220,46 +226,46 @@
}
mdc.addParameterDescriptionComposite(pdc);
- }
- }
+ }
+ }
- if (WSDLUtil.isOutputPresentForMEP(MEP)) {
- AxisMessage outAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+ if (WSDLUtil.isOutputPresentForMEP(MEP)) {
+ AxisMessage outAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
- if(outAxisMessage != null){
+ if(outAxisMessage != null){
- if(!method.getReturnType().toString().equals("void")){
- mdc.setReturnType(method.getReturnType().toString().split(" ")[1]);
+ if(!method.getReturnType().toString().equals("void")){
+ mdc.setReturnType(method.getReturnType().toString().split(" ")[1]);
- XmlSchemaElement element = outAxisMessage.getSchemaElement();
- XmlSchemaType schemaType = element.getSchemaType();
+ XmlSchemaElement element = outAxisMessage.getSchemaElement();
+ XmlSchemaType schemaType = element.getSchemaType();
- if(schemaType instanceof XmlSchemaComplexType){
+ if(schemaType instanceof XmlSchemaComplexType){
- XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
- XmlSchemaParticle particle = complexSchemaType.getParticle();
+ XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
+ XmlSchemaParticle particle = complexSchemaType.getParticle();
-// TODO: What if we have more than one complex type in a sequence ???
- if (particle instanceof XmlSchemaSequence) {
- XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
- Iterator iterator = xmlSchemaSequence.getItems().getIterator();
+// TODO: What if we have more than one complex type in a sequence ???
+ if (particle instanceof XmlSchemaSequence) {
+ XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
+ Iterator iterator = xmlSchemaSequence.getItems().getIterator();
- while (iterator.hasNext()) {
- XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
- XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
+ while (iterator.hasNext()) {
+ XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
+ XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
- if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
- element = innerElement;
- break;
- }else {
- XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
- XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
- XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
- iterator = innerXmlSchemaSequence.getItems().getIterator();
- }
- }
- }
- }
+ if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
+ element = innerElement;
+ break;
+ }else {
+ XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
+ XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
+ XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
+ iterator = innerXmlSchemaSequence.getItems().getIterator();
+ }
+ }
+ }
+ }
WebResultAnnot webResult = WebResultAnnot.createWebResultAnnotImpl();
webResult.setName(element.getName());
@@ -268,18 +274,17 @@
ResponseWrapperAnnot responseWrap = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
responseWrap.setClassName(getWrapperClassName(outAxisMessage.getElementQName()));
mdc.setResponseWrapperAnnot(responseWrap);
- }
-
- }
- }
+ }
+ }
+ }
- List faultMessages = operation.getFaultMessages();
- if(faultMessages != null){//TODO Implement it
+ List faultMessages = operation.getFaultMessages();
+ if(faultMessages != null){//TODO Implement it
- }
+ }
- mdc.setWebMethodAnnot(webMethodAnnot);
- dbc.addMethodDescriptionComposite(mdc);
+ mdc.setWebMethodAnnot(webMethodAnnot);
+ dbc.addMethodDescriptionComposite(mdc);
}
//TODO: Has to verify how JAXB default class wrapper class generation logic
@@ -334,5 +339,59 @@
composite.setWsdlDefinition(testMap);
return composite;
}
+ }
+
+ protected Definition getWSDLDefition(PortInfo portInfo, URL configurationBaseUrl, ClassLoader classLoader) throws IOException, WSDLException {
+ String wsdlFile = portInfo.getWsdlFile();
+ Definition wsdlDefinition = null;
+
+ if(wsdlFile == null || wsdlFile.equals(""))
+ return null;
+ else {
+ URL wsdlURL = getWsdlURL(wsdlFile, configurationBaseUrl, classLoader);
+ InputStream wsdlStream;
+ try {
+ wsdlStream = wsdlURL.openStream();
+ if(wsdlStream == null){
+ throw new IOException("unable to read descriptor " + wsdlURL);
+ }
+ else {
+ WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLReader reader = factory.newWSDLReader();
+ reader.setFeature("javax.wsdl.importDocuments", true);
+ reader.setFeature("javax.wsdl.verbose", false);
+ wsdlDefinition = reader.readWSDL(wsdlURL.toString());
+ wsdlStream.close();
+ }
+ } catch (RuntimeException e) {
+ throw new RuntimeException("invalid WSDL provided " + wsdlURL);
+ }
+ return wsdlDefinition;
+ }
+ }
+
+ private URL getWsdlURL(String wsdlFile, URL configurationBaseUrl, ClassLoader classLoader) {
+ URL wsdlURL = null;
+ if (wsdlFile != null) {
+
+ try {
+ wsdlURL = new URL(wsdlFile);
+ } catch (MalformedURLException e) {
+ // Not a URL, try as a resource
+ wsdlURL = classLoader.getResource("/" + wsdlFile);
+
+ if (wsdlURL == null && configurationBaseUrl != null) {
+ // Cannot get it as a resource, try with
+ // configurationBaseUrl
+ try {
+ wsdlURL = new URL(configurationBaseUrl.toString()
+ + wsdlFile);
+ } catch (MalformedURLException ee) {
+ // ignore
+ }
+ }
+ }
+ }
+ return wsdlURL;
}
}
Added: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/EJBWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/EJBWebServiceGBean.java?view=auto&rev=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/EJBWebServiceGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/EJBWebServiceGBean.java Mon Feb 26 12:18:33 2007
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.axis2;
+
+import java.net.URL;
+
+import javax.naming.Context;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jaxws.PortInfo;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.openejb.EjbDeployment;
+import org.apache.geronimo.webservices.SoapHandler;
+
+public class EJBWebServiceGBean implements GBeanLifecycle {
+
+ private SoapHandler soapHandler;
+ private String location;
+
+ public EJBWebServiceGBean(EjbDeployment ejbDeploymentContext,
+ PortInfo portInfo,
+ Kernel kernel,
+ URL configurationBaseUrl,
+ SoapHandler soapHandler,
+ String securityRealmName,
+ String realmName,
+ String transportGuarantee,
+ String authMethod,
+ String[] virtualHosts) throws Exception {
+ if (ejbDeploymentContext == null || soapHandler == null || portInfo == null) {
+ return;
+ }
+
+ this.location = portInfo.getLocation();
+
+ assert this.location != null : "null location received";
+
+ String beanClassName = ejbDeploymentContext.getBeanClass().getName();
+ Context context = ejbDeploymentContext.getComponentContext();
+
+ ClassLoader classLoader = ejbDeploymentContext.getClassLoader();
+
+ //TODO: need to invoke the EJB container and forward the call to the EJB container.
+
+ Axis2WebServiceContainer container =
+ new Axis2WebServiceContainer(portInfo, beanClassName, classLoader, context, configurationBaseUrl);
+
+ if (soapHandler != null) {
+ soapHandler.addWebService(this.location,
+ virtualHosts,
+ container,
+ securityRealmName,
+ realmName,
+ transportGuarantee,
+ authMethod,
+ classLoader);
+ }
+
+ }
+
+ public void doStart() throws Exception {
+ }
+
+ public void doStop() throws Exception {
+ if (this.soapHandler != null) {
+ this.soapHandler.removeWebService(this.location);
+ }
+ }
+
+ public void doFail() {
+ }
+
+ public static final GBeanInfo GBEAN_INFO;
+
+ static {
+ GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EJBWebServiceGBean.class, EJBWebServiceGBean.class, NameFactory.WEB_SERVICE_LINK);
+
+ infoFactory.addReference("EjbDeployment", EjbDeployment.class);
+ infoFactory.addAttribute("portInfo", PortInfo.class, true);
+ infoFactory.addAttribute("kernel", Kernel.class, false);
+ infoFactory.addAttribute("configurationBaseUrl", URL.class, true);
+ infoFactory.addAttribute("securityRealmName", String.class, true);
+ infoFactory.addAttribute("realmName", String.class, true);
+ infoFactory.addAttribute("transportGuarantee", String.class, true);
+ infoFactory.addAttribute("authMethod", String.class, true);
+ infoFactory.addAttribute("virtualHosts", String[].class, true);
+ infoFactory.addReference("WebServiceContainer", SoapHandler.class);
+
+ infoFactory.setConstructor(new String[]{
+ "EjbDeployment",
+ "portInfo",
+ "kernel",
+ "configurationBaseUrl",
+ "WebServiceContainer",
+ "securityRealmName",
+ "realmName",
+ "transportGuarantee",
+ "authMethod",
+ "virtualHosts"
+ });
+
+
+ GBEAN_INFO = infoFactory.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
+}
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java?view=diff&rev=511987&r1=511986&r2=511987
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2WebServiceContainerTest.java Mon Feb 26 12:18:33 2007
@@ -17,16 +17,12 @@
package org.apache.geronimo.axis2;
import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.HashMap;
-import javax.wsdl.Definition;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-
+import org.apache.geronimo.jaxws.PortInfo;
import org.apache.geronimo.webservices.WebServiceContainer.Request;
public class Axis2WebServiceContainerTest extends Axis2AbstractTestCase {
@@ -48,9 +44,7 @@
PortInfo portInfo = new PortInfo();
portInfo.setLocation("servlet");
- File file = new File(getTestFile("src/test/resources/"+wsdlFile));
- portInfo.setWsdlDefinition(readWSDL(file.toURL().toString()));
-
+
try {
Axis2Request req = new Axis2Request(504,
"text/xml; charset=utf-8",
@@ -70,7 +64,7 @@
out.flush();
} catch(Throwable ex){
- ex.printStackTrace();
+ ex.printStackTrace();
throw new Exception(ex.toString());
}finally {
if (in != null) {
@@ -81,15 +75,6 @@
}
}
}
- }
-
- private Definition readWSDL(String url) throws Exception{
- WSDLFactory factory = WSDLFactory.newInstance();
- WSDLReader reader = factory.newWSDLReader();
- reader.setFeature("javax.wsdl.importDocuments", true);
- reader.setFeature("javax.wsdl.verbose", false);
- Definition wsdlDefinition = reader.readWSDL(url);
- return wsdlDefinition;
}
protected void setUp() throws Exception {