tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r591858 [6/13] - in /openejb/trunk/openejb3: ./ assembly/openejb-tomcat/ assembly/openejb-tomcat/src/main/java/org/apache/openejb/tomcat/ container/openejb-core/ container/openejb-core/src/main/java/org/apache/openejb/ container/openejb-cor...
Date Sun, 04 Nov 2007 22:42:06 GMT
Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlMessageMapping.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlMessageMapping.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlMessageMapping.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlMessageMapping.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,104 @@
+/**
+ * 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.openejb.jee;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+/**
+ * The wsdl-message-mapping element defines the mapping to a
+ * specific message and its part. Together they define uniquely
+ * the mapping for a specific parameter. Parts within a message
+ * context are uniquely identified with their names.
+ * <p/>
+ * The parameter-mode is defined by the mapping to indicate
+ * whether the mapping will be IN, OUT, or INOUT..  The presence
+ * of the soap-header element indicates that the parameter is
+ * mapped to a soap header only.  When absent, it means that the
+ * wsdl-message is mapped to a Java parameter. The soap headers
+ * are interpreted in the order they are provided in the mapping.
+ * <p/>
+ * Used in: method-param-parts-mapping
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "wsdl-message-mappingType", propOrder = {
+    "wsdlMessage",
+    "wsdlMessagePartName",
+    "parameterMode",
+    "soapHeader"
+})
+public class WsdlMessageMapping {
+    @XmlElement(name = "wsdl-message", required = true)
+    protected QName wsdlMessage;
+    @XmlElement(name = "wsdl-message-part-name", required = true)
+    protected String wsdlMessagePartName;
+    @XmlElement(name = "parameter-mode", required = true)
+    protected String parameterMode;
+    @XmlElement(name = "soap-header")
+    protected Object soapHeader;
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    protected String id;
+
+    public QName getWsdlMessage() {
+        return wsdlMessage;
+    }
+
+    public void setWsdlMessage(QName value) {
+        this.wsdlMessage = value;
+    }
+
+    public String getWsdlMessagePartName() {
+        return wsdlMessagePartName;
+    }
+
+    public void setWsdlMessagePartName(String value) {
+        this.wsdlMessagePartName = value;
+    }
+
+    public String getParameterMode() {
+        return parameterMode;
+    }
+
+    public void setParameterMode(String value) {
+        this.parameterMode = value;
+    }
+
+    public Object getSoapHeader() {
+        return soapHeader;
+    }
+
+    public void setSoapHeader(Object value) {
+        this.soapHeader = value;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String value) {
+        this.id = value;
+    }
+}

Added: openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlReturnValueMapping.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlReturnValueMapping.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlReturnValueMapping.java (added)
+++ openejb/trunk/openejb3/container/openejb-jee/src/main/java/org/apache/openejb/jee/WsdlReturnValueMapping.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,88 @@
+/**
+ * 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.openejb.jee;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+/**
+ * The wsdl-return-value-mapping  element defines the mapping for the
+ * method's return value. It defines the mapping to a specific message
+ * and its part.  Together they define uniquely the mapping for a
+ * specific parameter. Parts within a message context are uniquely
+ * identified with their names. The wsdl-message-part-name is not
+ * specified if there is no return value or OUT parameters.
+ * <p/>
+ * Used in: service-endpoint-method-mapping
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "wsdl-return-value-mappingType", propOrder = {
+    "methodReturnValue",
+    "wsdlMessage",
+    "wsdlMessagePartName"
+})
+public class WsdlReturnValueMapping {
+    @XmlElement(name = "method-return-value", required = true)
+    protected String methodReturnValue;
+    @XmlElement(name = "wsdl-message", required = true)
+    protected QName wsdlMessage;
+    @XmlElement(name = "wsdl-message-part-name")
+    protected String wsdlMessagePartName;
+    @XmlAttribute
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    protected String id;
+
+    public String getMethodReturnValue() {
+        return methodReturnValue;
+    }
+
+    public void setMethodReturnValue(String value) {
+        this.methodReturnValue = value;
+    }
+
+    public QName getWsdlMessage() {
+        return wsdlMessage;
+    }
+
+    public void setWsdlMessage(QName value) {
+        this.wsdlMessage = value;
+    }
+
+    public String getWsdlMessagePartName() {
+        return wsdlMessagePartName;
+    }
+
+    public void setWsdlMessagePartName(String value) {
+        this.wsdlMessagePartName = value;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String value) {
+        this.id = value;
+    }
+}

Modified: openejb/trunk/openejb3/container/openejb-jee/src/test/resources/web-example.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-jee/src/test/resources/web-example.xml?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-jee/src/test/resources/web-example.xml (original)
+++ openejb/trunk/openejb3/container/openejb-jee/src/test/resources/web-example.xml Sun Nov  4 14:41:49 2007
@@ -484,8 +484,8 @@
             <handler-chain id="ID149">
                 <service-name-pattern>*</service-name-pattern>
                 <handler id="ID151">
-                    <description xml:lang="" id="ID153">description6</description>
-                    <display-name xml:lang="en-US" id="ID155">display-name3</display-name>
+                    <description>description6</description>
+                    <display-name>display-name3</display-name>
                     <icon xml:lang="" id="ID157">
                         <small-icon>small-icon3</small-icon>
                         <large-icon>large-icon3</large-icon>
@@ -502,8 +502,8 @@
                     <port-name>port-name0</port-name>
                 </handler>
                 <handler id="ID181">
-                    <description xml:lang="en-US" id="ID183">description8</description>
-                    <display-name xml:lang="en-US" id="ID185">display-name4</display-name>
+                    <description>description8</description>
+                    <display-name>display-name4</display-name>
                     <icon xml:lang="en-US" id="ID187">
                         <small-icon>small-icon4</small-icon>
                         <large-icon>large-icon4</large-icon>
@@ -546,8 +546,8 @@
             <port-component-link>port-component-link1</port-component-link>
         </port-component-ref>
         <handler id="I3391">
-            <description xml:lang="" id="I3393">description219</description>
-            <display-name xml:lang="" id="I3395">display-name107</display-name>
+            <description>description219</description>
+            <display-name>display-name107</display-name>
             <icon xml:lang="" id="I3397">
                 <small-icon>small-icon107</small-icon>
                 <large-icon>large-icon107</large-icon>
@@ -591,8 +591,8 @@
             <handler-chain id="I3611">
                 <service-name-pattern>*</service-name-pattern>
                 <handler id="I3613">
-                    <description xml:lang="" id="I3615">description230</description>
-                    <display-name xml:lang="en-US" id="I3617">display-name109</display-name>
+                    <description>description230</description>
+                    <display-name>display-name109</display-name>
                     <icon xml:lang="en-US" id="I3619">
                         <small-icon>small-icon109</small-icon>
                         <large-icon>large-icon109</large-icon>
@@ -609,8 +609,8 @@
                     <port-name>port-name101</port-name>
                 </handler>
                 <handler id="I3643">
-                    <description xml:lang="" id="I3645">description232</description>
-                    <display-name xml:lang="en-US" id="I3647">display-name110</display-name>
+                    <description>description232</description>
+                    <display-name>display-name110</display-name>
                     <icon xml:lang="" id="I3649">
                         <small-icon>small-icon110</small-icon>
                         <large-icon>large-icon110</large-icon>
@@ -627,8 +627,8 @@
                     <port-name>port-name102</port-name>
                 </handler>
                 <handler id="I3673">
-                    <description xml:lang="en-US" id="I3675">description234</description>
-                    <display-name xml:lang="" id="I3677">display-name111</display-name>
+                    <description>description234</description>
+                    <display-name>display-name111</display-name>
                     <icon xml:lang="en-US" id="I3679">
                         <small-icon>small-icon111</small-icon>
                         <large-icon>large-icon111</large-icon>

Modified: openejb/trunk/openejb3/examples/ejb-examples/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/pom.xml?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/pom.xml (original)
+++ openejb/trunk/openejb3/examples/ejb-examples/pom.xml Sun Nov  4 14:41:49 2007
@@ -33,6 +33,18 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+      <version>1.1.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.axis2</groupId>
+      <artifactId>axis2-jaxws-api</artifactId>
+      <version>1.3</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjb.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjb.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjb.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace="http://examples.org/wsdl")
+public interface HelloEjb {
+    String hello(String name);
+}

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjbService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjbService.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjbService.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloEjbService.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,35 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.jws.WebService;
+import javax.ejb.Stateless;
+
+@WebService(
+    portName="HelloEjbPort",
+    serviceName="HelloEjbService",
+    targetNamespace="http://examples.org/wsdl",
+    endpointInterface="org.apache.openejb.examples.servlet.HelloEjb"
+)
+@Stateless
+public class HelloEjbService implements HelloEjb {
+    public String hello(String name) {
+        if (name == null) name = "World";
+        return "Hello " + name + " from EJB Webservice!";
+    }
+}

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojo.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojo.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojo.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace="http://examples.org/wsdl")
+public interface HelloPojo {
+    String hello(String name);
+}

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojoService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojoService.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojoService.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/HelloPojoService.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.jws.WebService;
+
+@WebService(
+    portName="HelloPojoPort",
+    serviceName="HelloPojoService",
+    targetNamespace="http://examples.org/wsdl",
+    endpointInterface="org.apache.openejb.examples.servlet.HelloPojo"
+)
+public class HelloPojoService implements HelloPojo {
+    public String hello(String name) {
+        if (name == null) name = "World";
+        return "Hello " + name + " from Pojo Webservice!";
+    }
+}

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceClient.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceClient.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceClient.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceClient.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,79 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.xml.ws.Service;
+import java.io.PrintStream;
+import java.net.URL;
+
+public class WebserviceClient {
+    /**
+     * Unfortunately, to run this example with CXF you need to have a HUGE class path.  This
+     * is just what is required to run CXF:
+     * <p/>
+     * jaxb-api-2.0.jar
+     * jaxb-impl-2.0.3.jar
+     * <p/>
+     * saaj-api-1.3.jar
+     * saaj-impl-1.3.jar
+     * <p/>
+     * <p/>
+     * cxf-api-2.0.2-incubator.jar
+     * cxf-common-utilities-2.0.2-incubator.jar
+     * cxf-rt-bindings-soap-2.0.2-incubator.jar
+     * cxf-rt-core-2.0.2-incubator.jar
+     * cxf-rt-databinding-jaxb-2.0.2-incubator.jar
+     * cxf-rt-frontend-jaxws-2.0.2-incubator.jar
+     * cxf-rt-frontend-simple-2.0.2-incubator.jar
+     * cxf-rt-transports-http-jetty-2.0.2-incubator.jar
+     * cxf-rt-transports-http-2.0.2-incubator.jar
+     * cxf-tools-common-2.0.2-incubator.jar
+     * <p/>
+     * geronimo-activation_1.1_spec-1.0.jar
+     * geronimo-annotation_1.0_spec-1.1.jar
+     * geronimo-ejb_3.0_spec-1.0.jar
+     * geronimo-jpa_3.0_spec-1.1.jar
+     * geronimo-servlet_2.5_spec-1.1.jar
+     * geronimo-stax-api_1.0_spec-1.0.jar
+     * jaxws-api-2.0.jar
+     * axis2-jws-api-1.3.jar
+     * <p/>
+     * wsdl4j-1.6.1.jar
+     * xml-resolver-1.2.jar
+     * XmlSchema-1.3.1.jar
+     */
+    public static void main(String[] args) throws Exception {
+        PrintStream out = System.out;
+
+        Service helloPojoService = Service.create(new URL("http://localhost:8080/ejb-examples/hello?wsdl"), null);
+        HelloPojo helloPojo = helloPojoService.getPort(HelloPojo.class);
+        out.println();
+        out.println("Pojo Webservice");
+        out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
+        out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
+        out.println();
+
+        Service helloEjbService = Service.create(new URL("http://localhost:8080/HelloEjbService?wsdl"), null);
+        HelloEjb helloEjb = helloEjbService.getPort(HelloEjb.class);
+        out.println();
+        out.println("EJB Webservice");
+        out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
+        out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
+        out.println();
+    }
+}

Added: openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceServlet.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceServlet.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceServlet.java (added)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/java/org/apache/openejb/examples/servlet/WebserviceServlet.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,48 @@
+/**
+ *
+ * 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.openejb.examples.servlet;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import java.io.IOException;
+
+public class WebserviceServlet extends HttpServlet {
+    @WebServiceRef
+    private HelloPojo helloPojo;
+
+    @WebServiceRef
+    private HelloEjb helloEjb;
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        response.setContentType("text/plain");
+        ServletOutputStream out = response.getOutputStream();
+
+        out.println("Pojo Webservice");
+        out.println("    helloPojo.hello(\"Bob\")=" + helloPojo.hello("Bob"));
+        out.println("    helloPojo.hello(null)=" + helloPojo.hello(null));
+        out.println();
+        out.println("EJB Webservice");
+        out.println("    helloEjb.hello(\"Bob\")=" + helloEjb.hello("Bob"));
+        out.println("    helloEjb.hello(null)=" + helloEjb.hello(null));
+        out.println();
+    }
+}

Modified: openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/WEB-INF/web.xml?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/WEB-INF/web.xml (original)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/WEB-INF/web.xml Sun Nov  4 14:41:49 2007
@@ -88,6 +88,27 @@
     </auth-constraint>
   </security-constraint>
 
+  <servlet>
+    <servlet-name>WebserviceServlet</servlet-name>
+    <servlet-class>org.apache.openejb.examples.servlet.WebserviceServlet</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>WebserviceServlet</servlet-name>
+    <url-pattern>/webservice/*</url-pattern>
+  </servlet-mapping>
+
+
+  <servlet>
+    <servlet-name>HelloPojoService</servlet-name>
+    <servlet-class>org.apache.openejb.examples.servlet.HelloPojoService</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>HelloPojoService</servlet-name>
+    <url-pattern>/hello</url-pattern>
+  </servlet-mapping>
+
   <login-config>
     <auth-method>BASIC</auth-method>
   </login-config>

Modified: openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/index.jsp?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/index.jsp (original)
+++ openejb/trunk/openejb3/examples/ejb-examples/src/main/webapp/index.jsp Sun Nov  4 14:41:49 2007
@@ -4,6 +4,7 @@
 <a href="annotated">Annotated Servlet</a> <br>
 <a href="jpa">JPA Example</a> <br>
 <a href="jndi">JNDI Dump</a> <br>
+<a href="webservice">Webservice</a> <br>
 
 <h2>Security Examples</h2>
 <a href="secure">Secure</a> <br>

Modified: openejb/trunk/openejb3/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/pom.xml?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/pom.xml (original)
+++ openejb/trunk/openejb3/pom.xml Sun Nov  4 14:41:49 2007
@@ -363,6 +363,20 @@
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
         <version>1.1</version>
+        <exclusions>
+          <exclusion>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>avalon-framework</groupId>
+            <artifactId>avalon-framework</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>logkit</groupId>
+            <artifactId>logkit</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>hsqldb</groupId>
@@ -702,6 +716,13 @@
         <artifactId>commons-collections</artifactId>
         <version>3.2</version>
       </dependency>
+
+      <dependency>
+        <groupId>axis</groupId>
+        <artifactId>axis</artifactId>
+        <version>1.4</version>
+      </dependency>
+
       <dependency>
         <groupId>org.apache.axis2</groupId>
         <artifactId>axis2-jaxws-api</artifactId>
@@ -755,8 +776,30 @@
             <groupId>xmlunit</groupId>
             <artifactId>xmlunit</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
+
+      <dependency>
+          <groupId>wsdl4j</groupId>
+          <artifactId>wsdl4j</artifactId>
+          <version>1.6.1</version>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.axis2</groupId>
+          <artifactId>axis2-saaj-api</artifactId>
+          <version>1.3</version>
+          <exclusions>
+            <exclusion>
+              <groupId>javax.servlet</groupId>
+              <artifactId>servlet-api</artifactId>
+            </exclusion>
+          </exclusions>
+      </dependency>
+      
     </dependencies>
   </dependencyManagement>
   <distributionManagement>

Propchange: openejb/trunk/openejb3/server/openejb-axis/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Nov  4 14:41:49 2007
@@ -1,8 +1,10 @@
+*.iws
 *.ipr
 *.iml
-*.iws
-*~
-.project
 .classpath
+.project
 .settings
+*.log
+junit*.properties
 target
+bin

Modified: openejb/trunk/openejb3/server/openejb-axis/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/pom.xml?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/pom.xml (original)
+++ openejb/trunk/openejb3/server/openejb-axis/pom.xml Sun Nov  4 14:41:49 2007
@@ -33,28 +33,17 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.openejb</groupId>
-      <artifactId>openejb-core</artifactId>
+      <artifactId>openejb-webservices</artifactId>
       <version>${version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.openejb</groupId>
-      <artifactId>openejb-server</artifactId>
-      <version>${version}</version>
+      <groupId>axis</groupId>
+      <artifactId>axis</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.openejb</groupId>
       <artifactId>openejb-itests-client</artifactId>
       <version>${version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>axis</groupId>
-      <artifactId>axis</artifactId>
-      <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisService.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisService.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisService.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,105 @@
+/**
+ *
+ * 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.openejb.server.axis;
+
+import org.apache.axis.handlers.HandlerInfoChainFactory;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.openejb.DeploymentInfo;
+import org.apache.openejb.core.webservices.HandlerChainData;
+import org.apache.openejb.core.webservices.HandlerData;
+import org.apache.openejb.core.webservices.PortData;
+import org.apache.openejb.server.httpd.HttpListener;
+import org.apache.openejb.server.webservices.WsService;
+
+import javax.naming.Context;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.HandlerInfo;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class AxisService extends WsService {
+    private final Map<String, AxisWsContainer> wsContainers = new TreeMap<String, AxisWsContainer>();
+
+    public String getName() {
+        return "axis";
+    }
+
+    protected HttpListener createEjbWsContainer(URL moduleBaseUrl, PortData port, DeploymentInfo deploymentInfo) throws Exception {
+        RPCProvider provider = new EjbContainerProvider(deploymentInfo, createHandlerInfos(port.getHandlerChains()));
+        SOAPService service = new SOAPService(null, provider, null);
+        AxisWsContainer container = new AxisWsContainer(port.getWsdlUrl(), service, null, deploymentInfo.getClassLoader());
+        wsContainers.put(deploymentInfo.getDeploymentID().toString(), container);
+        return container;
+    }
+
+    protected void destroyEjbWsContainer(String deploymentId) {
+        AxisWsContainer container = wsContainers.remove(deploymentId);
+        if (container != null) {
+            container.destroy();
+        }
+    }
+
+    protected HttpListener createPojoWsContainer(URL moduleBaseUrl, PortData port, String serviceId, Class target, Context context, String contextRoot) throws Exception {
+        RPCProvider provider = new PojoProvider();
+        SOAPService service = new SOAPService(null, provider, null);
+
+        // todo need to port this code
+        // ServiceInfo serviceInfo = createServiceInfo(portInfo, classLoader);
+        // JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
+        // service.setServiceDescription(serviceDesc);
+        service.setOption("className", target.getName());
+
+        List<HandlerInfo> handlerInfos = createHandlerInfos(port.getHandlerChains());
+        HandlerInfoChainFactory handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
+        service.setOption(org.apache.axis.Constants.ATTR_HANDLERINFOCHAIN, handlerInfoChainFactory);
+
+
+        AxisWsContainer container = new AxisWsContainer(port.getWsdlUrl(), service, null, target.getClassLoader());
+        wsContainers.put(serviceId, container);
+        return container;
+    }
+
+    protected void destroyPojoWsContainer(String serviceId) {
+        AxisWsContainer container = wsContainers.remove(serviceId);
+        if (container != null) {
+            container.destroy();
+        }
+    }
+
+    @SuppressWarnings({"unchecked"})
+    private List<HandlerInfo> createHandlerInfos(List<HandlerChainData> handlerChains) throws ClassNotFoundException {
+        if (handlerChains == null || handlerChains.isEmpty()) return null;
+        List<HandlerData> handlers = handlerChains.get(0).getHandlers();
+
+        List<HandlerInfo> handlerInfos = new ArrayList<HandlerInfo>(handlers.size());
+        for (HandlerData handler : handlers) {
+            Class<?> handlerClass = handler.getHandlerClass();
+            Map initParams = new HashMap(handler.getInitParams());
+            QName[] headers = handler.getSoapHeaders().toArray(new QName[handler.getSoapHeaders().size()]);
+            HandlerInfo handlerInfo = new HandlerInfo(handlerClass, initParams, headers);
+            handlerInfos.add(handlerInfo);
+        }
+
+        return handlerInfos;
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisWsContainer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisWsContainer.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisWsContainer.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/AxisWsContainer.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,323 @@
+/**
+ *   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.openejb.server.axis;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+import javax.wsdl.OperationType;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.axis.AxisEngine;
+import org.apache.axis.AxisFault;
+import org.apache.axis.Constants;
+import org.apache.axis.Message;
+import org.apache.axis.MessageContext;
+import org.apache.axis.SOAPPart;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axis.soap.SOAPConstants;
+import org.apache.axis.transport.http.HTTPConstants;
+import org.apache.axis.utils.Messages;
+import org.apache.openejb.server.webservices.WsConstants;
+import org.apache.openejb.server.webservices.saaj.SaajUniverse;
+import org.apache.openejb.server.httpd.HttpRequest;
+import org.apache.openejb.server.httpd.HttpResponse;
+import org.apache.openejb.server.httpd.HttpListener;
+import org.apache.openejb.util.Logger;
+import org.apache.openejb.util.LogCategory;
+import org.w3c.dom.Element;
+
+public class AxisWsContainer implements HttpListener {
+    private static final Logger logger = Logger.getInstance(LogCategory.AXIS, AxisWsContainer.class);
+    public static final String REQUEST = AxisWsContainer.class.getName() + "@Request";
+    public static final String RESPONSE = AxisWsContainer.class.getName() + "@Response";
+
+    public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
+
+    private final URL wsdlLocation;
+    private final SOAPService service;
+
+    private final ClassLoader classLoader;
+    private final Map wsdlMap;
+
+    public AxisWsContainer(URL wsdlURL, SOAPService service, Map wsdlMap, ClassLoader classLoader) {
+        this.wsdlLocation = wsdlURL;
+        this.service = service;
+        this.wsdlMap = wsdlMap;
+        if (classLoader == null) {
+            this.classLoader = Thread.currentThread().getContextClassLoader();
+        } else {
+            this.classLoader = classLoader;
+        }
+    }
+
+    public void onMessage(HttpRequest request, HttpResponse response) throws Exception {
+        SaajUniverse universe = new SaajUniverse();
+        universe.set(SaajUniverse.AXIS1);
+        try {
+            doService(request, response);
+        } finally {
+            universe.unset();
+        }
+    }
+    
+    protected void doService(HttpRequest req, HttpResponse res) throws Exception {
+        org.apache.axis.MessageContext messageContext = new org.apache.axis.MessageContext(null);
+        req.setAttribute(WsConstants.MESSAGE_CONTEXT, messageContext);
+
+        messageContext.setClassLoader(classLoader);
+
+        Message responseMessage = null;
+
+        String contentType = req.getHeader(HTTPConstants.HEADER_CONTENT_TYPE);
+        String contentLocation = req.getHeader(HTTPConstants.HEADER_CONTENT_LOCATION);
+        InputStream inputStream = req.getInputStream();
+        Message requestMessage = new Message(inputStream, false, contentType, contentLocation);
+
+        messageContext.setRequestMessage(requestMessage);
+        messageContext.setProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO, req.getURI().getPath());
+        messageContext.setProperty(org.apache.axis.MessageContext.TRANS_URL, req.getURI().toString());
+        messageContext.setService(service);
+        messageContext.setProperty(REQUEST, req);
+        messageContext.setProperty(RESPONSE, res);
+        messageContext.setProperty(AxisEngine.PROP_DISABLE_PRETTY_XML, Boolean.TRUE);
+
+        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            try {
+                String characterEncoding = (String) requestMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
+                if (characterEncoding != null) {
+                    messageContext.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, characterEncoding);
+                } else {
+                    messageContext.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8");
+                }
+
+
+                String soapAction = req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
+                if (soapAction != null) {
+                    messageContext.setUseSOAPAction(true);
+                    messageContext.setSOAPActionURI(soapAction);
+                }
+
+                SOAPEnvelope env = requestMessage.getSOAPEnvelope();
+                if (env != null && env.getSOAPConstants() != null) {
+                    messageContext.setSOAPConstants(env.getSOAPConstants());
+                }
+                SOAPService service = messageContext.getService();
+
+                Thread.currentThread().setContextClassLoader(classLoader);
+                service.invoke(messageContext);
+
+                responseMessage = messageContext.getResponseMessage();
+            } catch (AxisFault fault) {
+                
+               	if(req.getMethod() == HttpRequest.GET && req.getParameters().isEmpty()){
+               		String serviceName = req.getURI().getRawPath();
+                    serviceName = serviceName.substring(serviceName.lastIndexOf("/")+1);
+               		printServiceInfo(res,serviceName);
+               		return;
+               	}else{
+               		responseMessage = handleFault(fault, res, messageContext);
+               	}
+
+            } catch (Exception e) {
+                responseMessage = handleException(messageContext, res, e);
+            }
+            //TODO investigate and fix operation == null!
+            if (messageContext.getOperation() != null) {
+                if (messageContext.getOperation().getMep() == OperationType.ONE_WAY) {
+                    // No content, so just indicate accepted
+                    res.setStatusCode(202);
+                    return;
+                } else if (responseMessage == null) {
+                    responseMessage = handleException(messageContext, null, new RuntimeException("No response for non-one-way operation"));
+                }
+            } else if (responseMessage == null) {
+                res.setStatusCode(202);
+                return;
+            }
+            try {
+                SOAPConstants soapConstants = messageContext.getSOAPConstants();
+                String contentType1 = responseMessage.getContentType(soapConstants);
+                res.setContentType(contentType1);
+                // Transfer MIME headers to HTTP headers for response message.
+                MimeHeaders responseMimeHeaders = responseMessage.getMimeHeaders();
+                for (Iterator i = responseMimeHeaders.getAllHeaders(); i.hasNext();) {
+                    MimeHeader responseMimeHeader = (MimeHeader) i.next();
+                    res.setHeader(responseMimeHeader.getName(),
+                            responseMimeHeader.getValue());
+                }
+                //TODO discuss this with dims.
+//                // synchronize the character encoding of request and response
+//                String responseEncoding = (String) messageContext.getProperty(
+//                        SOAPMessage.CHARACTER_SET_ENCODING);
+//                if (responseEncoding != null) {
+//                    try {
+//                        responseMessage.setProperty(SOAPMessage.CHARACTER_SET_ENCODING,
+//                                                responseEncoding);
+//                    } catch (SOAPException e) {
+//                        log.info(Messages.getMessage("exception00"), e);
+//                    }
+//                }
+                //determine content type from message response
+                contentType = responseMessage.getContentType(messageContext.
+                        getSOAPConstants());
+                responseMessage.writeTo(res.getOutputStream());
+            } catch (Exception e) {
+                logger.warning(Messages.getMessage("exception00"), e);
+            }
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldClassLoader);
+        }
+    }
+
+    private Message handleException(MessageContext context, HttpResponse res, Exception e) {
+        Message responseMessage;
+        //other exceptions are internal trouble
+        responseMessage = context.getResponseMessage();
+        res.setStatusCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+        Message responseMsg = responseMessage;
+        logger.warning(Messages.getMessage("exception00"), e);
+        if (responseMsg == null) {
+            AxisFault fault = AxisFault.makeFault(e);
+            //log the fault
+            Element runtimeException = fault.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
+            if (runtimeException != null) {
+                logger.debug(Messages.getMessage("axisFault00"), fault);
+                //strip runtime details
+                fault.removeFaultDetail(Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
+            }
+            responseMsg = new Message(fault);
+        }
+        responseMessage = responseMsg;
+        SOAPPart soapPart = (SOAPPart) responseMessage.getSOAPPart();
+        soapPart.getMessage().setMessageContext(context);
+        return responseMessage;
+    }
+
+    private Message handleFault(AxisFault fault, HttpResponse res, MessageContext context) {
+        Message responseMessage;
+        Element runtimeException = fault.lookupFaultDetail(Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
+
+        logger.warning(Messages.getMessage("axisFault00"), fault);
+        if (runtimeException != null) {
+            //strip runtime details
+            fault.removeFaultDetail(Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
+        }
+
+        int status = fault.getFaultCode().getLocalPart().startsWith("Server.Unauth")
+                ? HttpServletResponse.SC_UNAUTHORIZED
+                : HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+        if (status == HttpServletResponse.SC_UNAUTHORIZED) {
+            // unauth access results in authentication request
+            // TODO: less generic realm choice?
+            res.setHeader("WWW-Authenticate", "Basic realm=\"AXIS\"");
+        }
+        res.setStatusCode(status);
+        responseMessage = context.getResponseMessage();
+        if (responseMessage == null) {
+            responseMessage = new Message(fault);
+            SOAPPart soapPart = (SOAPPart) responseMessage.getSOAPPart();
+            soapPart.getMessage().setMessageContext(context);
+        }
+        return responseMessage;
+    }
+
+    public void getWsdl(HttpRequest request, HttpResponse response) throws Exception {
+        URI realLocation = request.getURI();
+//        log.info("Request at " + realLocation);
+        String query = realLocation.getQuery();
+        if (query == null || !query.toLowerCase().startsWith("wsdl")) {
+            throw new IllegalStateException("request must contain a  wsdl or WSDL parameter: " + request.getParameters());
+        }
+        String locationKey;
+        if (query.length() > 4) {
+            locationKey = query.substring(5);
+        } else {
+            locationKey = wsdlLocation.toString();
+        }
+        Object wsdl = wsdlMap.get(locationKey);
+        if (wsdl == null) {
+            throw new IllegalStateException("No wsdl or schema known at location: " + locationKey);
+        }
+        URI updated = new URI(realLocation.getScheme(),
+                realLocation.getUserInfo(),
+                realLocation.getHost(),
+                realLocation.getPort(),
+                null, //try null for no path
+                null,
+                null);
+        String replaced = ((String) wsdl).replaceAll(WsConstants.LOCATION_REPLACEMENT_TOKEN, updated.toString());
+        response.getOutputStream().write(replaced.getBytes());
+        response.getOutputStream().flush();
+    }
+
+    public void destroy() {
+    }
+
+    /**
+     * print a snippet of service info.
+     * @param response response
+     * @param serviceName Name of the service
+     */
+
+    private void printServiceInfo(HttpResponse response,String serviceName) throws IOException{
+        response.setContentType("text/html; charset=utf-8");
+        StringBuffer output = new StringBuffer("<h1>")
+                .append(serviceName).append("</h1>\n");
+
+        output.append("<p>").append(Messages.getMessage("axisService00"))
+                .append("</p>\n");
+        output.append(
+                "<i>").append(
+                Messages.getMessage("perhaps00") ).append(
+                "</i>\n");
+        response.getOutputStream().write(output.toString().getBytes());
+    }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Modified: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/EjbContainerProvider.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/EjbContainerProvider.java?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/EjbContainerProvider.java (original)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/EjbContainerProvider.java Sun Nov  4 14:41:49 2007
@@ -54,9 +54,6 @@
 import java.util.List;
 import java.util.Vector;
 
-/**
- * @version $Rev$ $Date$
- */
 public class EjbContainerProvider extends RPCProvider {
 
     private final DeploymentInfo ejbDeployment;
@@ -64,7 +61,7 @@
 
     public EjbContainerProvider(DeploymentInfo ejbDeployment) {
         this.ejbDeployment = ejbDeployment;
-        this.handlerInfos = new ArrayList();
+        this.handlerInfos = new ArrayList<HandlerInfo>();
     }
 
     public EjbContainerProvider(DeploymentInfo ejbDeployment, List<HandlerInfo> handlerInfos) {

Modified: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/HandlerChainImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/HandlerChainImpl.java?rev=591858&r1=591857&r2=591858&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/HandlerChainImpl.java (original)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/HandlerChainImpl.java Sun Nov  4 14:41:49 2007
@@ -28,21 +28,22 @@
 import javax.xml.soap.SOAPMessage;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Stack;
 
 /**
  * Implementation of HandlerChain
  */
 public class HandlerChainImpl extends ArrayList implements javax.xml.rpc.handler.HandlerChain {
     private String[] roles;
-    private Stack invokedHandlers = new Stack();
+    private LinkedList<Handler> invokedHandlers = new LinkedList<Handler>();
 
     public HandlerChainImpl(List<HandlerInfo> handlerInfos) {
         this(handlerInfos, null);
     }
 
+    @SuppressWarnings({"unchecked"})
     public HandlerChainImpl(List<HandlerInfo> handlerInfos, String[] roles) {
         this.roles = roles;
         for (int i = 0; i < handlerInfos.size(); i++) {
@@ -86,7 +87,7 @@
         try {
             for (int i = 0; i < size(); i++) {
                 Handler currentHandler = (Handler) get(i);
-                invokedHandlers.push(currentHandler);
+                invokedHandlers.addFirst(currentHandler);
                 try {
                     if (!currentHandler.handleRequest(context)) {
                         return false;
@@ -163,7 +164,7 @@
      */
     static class MessageSnapshot {
         private final String operationName;
-        private final List parameterNames;
+        private final List<String> parameterNames;
 
         public MessageSnapshot(MessageContext soapMessage) {
             SOAPMessage message = ((SOAPMessageContext) soapMessage).getMessage();
@@ -176,7 +177,7 @@
                 SOAPElement operation = ((SOAPElement) body.getChildElements().next());
                 this.operationName = operation.getElementName().toString();
 
-                this.parameterNames = new ArrayList();
+                this.parameterNames = new ArrayList<String>();
                 for (Iterator i = operation.getChildElements(); i.hasNext();) {
                     SOAPElement parameter = (SOAPElement) i.next();
                     String element = parameter.getElementName().toString();

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/PojoProvider.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/PojoProvider.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/PojoProvider.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/PojoProvider.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,46 @@
+/**
+ *  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.openejb.server.axis;
+
+import org.apache.axis.Handler;
+import org.apache.axis.MessageContext;
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.openejb.server.httpd.HttpRequest;
+import org.apache.openejb.server.webservices.WsConstants;
+
+import javax.xml.rpc.holders.IntHolder;
+import java.lang.reflect.Method;
+
+public class PojoProvider extends RPCProvider {
+    public Object getServiceObject(MessageContext msgContext, Handler service, String clsName, IntHolder scopeHolder) throws Exception {
+        HttpRequest request = (HttpRequest) msgContext.getProperty(AxisWsContainer.REQUEST);
+        return request.getAttribute(WsConstants.POJO_INSTANCE);
+    }
+
+    protected Object invokeMethod(MessageContext msgContext, Method interfaceMethod, Object pojo, Object[] arguments) throws Exception {
+        Class pojoClass = pojo.getClass();
+
+        Method pojoMethod = null;
+        try {
+            pojoMethod = pojoClass.getMethod(interfaceMethod.getName(), interfaceMethod.getParameterTypes());
+        } catch (NoSuchMethodException e) {
+            throw (NoSuchMethodException) new NoSuchMethodException("The pojo class '" + pojoClass.getName() + "' does not have a method matching signature: " + interfaceMethod).initCause(e);
+        }
+
+        return pojoMethod.invoke(pojo, arguments);
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/ReadOnlyServiceDesc.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/ReadOnlyServiceDesc.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/ReadOnlyServiceDesc.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/ReadOnlyServiceDesc.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,185 @@
+/**
+ *  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.openejb.server.axis;
+
+import org.apache.axis.constants.Style;
+import org.apache.axis.constants.Use;
+import org.apache.axis.description.JavaServiceDesc;
+import org.apache.axis.description.OperationDesc;
+import org.apache.axis.encoding.TypeMapping;
+import org.apache.axis.encoding.TypeMappingRegistry;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ReadOnlyServiceDesc extends JavaServiceDesc {
+    private JavaServiceDesc serviceDesc;
+
+    public ReadOnlyServiceDesc(JavaServiceDesc serviceDesc) {
+        this.serviceDesc = serviceDesc;
+    }
+
+    public Class getImplClass() {
+        return serviceDesc.getImplClass();
+    }
+
+    public void setImplClass(Class implClass) {
+        serviceDesc.setImplClass(implClass);
+    }
+
+    public ArrayList getStopClasses() {
+        return serviceDesc.getStopClasses();
+    }
+
+    public void setStopClasses(ArrayList stopClasses) {
+    }
+
+    public void loadServiceDescByIntrospection() {
+        serviceDesc.loadServiceDescByIntrospection();
+    }
+
+    public void loadServiceDescByIntrospection(Class implClass) {
+        serviceDesc.loadServiceDescByIntrospection(implClass);
+    }
+
+    public void loadServiceDescByIntrospection(Class cls, TypeMapping tm) {
+        serviceDesc.loadServiceDescByIntrospection(cls, tm);
+    }
+
+    public Style getStyle() {
+        return serviceDesc.getStyle();
+    }
+
+    public void setStyle(Style style) {
+    }
+
+    public Use getUse() {
+        return serviceDesc.getUse();
+    }
+
+    public void setUse(Use use) {
+    }
+
+    public String getWSDLFile() {
+        return serviceDesc.getWSDLFile();
+    }
+
+    public void setWSDLFile(String wsdlFileName) {
+    }
+
+    public List getAllowedMethods() {
+        return serviceDesc.getAllowedMethods();
+    }
+
+    public void setAllowedMethods(List allowedMethods) {
+    }
+
+    public TypeMapping getTypeMapping() {
+        return serviceDesc.getTypeMapping();
+    }
+
+    public void setTypeMapping(TypeMapping tm) {
+    }
+
+    public String getName() {
+        return serviceDesc.getName();
+    }
+
+    public void setName(String name) {
+    }
+
+    public String getDocumentation() {
+        return serviceDesc.getDocumentation();
+    }
+
+    public void setDocumentation(String documentation) {
+    }
+
+    public void removeOperationDesc(OperationDesc operation) {
+    }
+
+    public void addOperationDesc(OperationDesc operation) {
+    }
+
+    public ArrayList getOperations() {
+        return serviceDesc.getOperations();
+    }
+
+    public OperationDesc[] getOperationsByName(String methodName) {
+        return serviceDesc.getOperationsByName(methodName);
+    }
+
+    public OperationDesc getOperationByName(String methodName) {
+        return serviceDesc.getOperationByName(methodName);
+    }
+
+    public OperationDesc getOperationByElementQName(QName qname) {
+        return serviceDesc.getOperationByElementQName(qname);
+    }
+
+    public OperationDesc[] getOperationsByQName(QName qname) {
+        return serviceDesc.getOperationsByQName(qname);
+    }
+
+    public void setNamespaceMappings(List namespaces) {
+    }
+
+    public String getDefaultNamespace() {
+        return serviceDesc.getDefaultNamespace();
+    }
+
+    public void setDefaultNamespace(String namespace) {
+    }
+
+    public void setProperty(String name, Object value) {
+        serviceDesc.setProperty(name, value);
+    }
+
+    public Object getProperty(String name) {
+        return serviceDesc.getProperty(name);
+    }
+
+    public String getEndpointURL() {
+        return serviceDesc.getEndpointURL();
+    }
+
+    public void setEndpointURL(String endpointURL) {
+    }
+
+    public TypeMappingRegistry getTypeMappingRegistry() {
+        return serviceDesc.getTypeMappingRegistry();
+    }
+
+    public void setTypeMappingRegistry(TypeMappingRegistry tmr) {
+    }
+
+    public boolean isInitialized() {
+        return serviceDesc.isInitialized();
+    }
+
+    public boolean isWrapped() {
+        return serviceDesc.isWrapped();
+    }
+
+    public List getDisallowedMethods() {
+        return serviceDesc.getDisallowedMethods();
+    }
+
+    public void setDisallowedMethods(List disallowedMethods) {
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/ArrayTypeInfo.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,93 @@
+/**
+ *  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.openejb.server.axis.client;
+
+import org.apache.axis.description.FieldDesc;
+import org.apache.axis.encoding.ser.ArrayDeserializerFactory;
+import org.apache.axis.encoding.ser.ArraySerializerFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.encoding.TypeMapping;
+
+public class ArrayTypeInfo extends TypeInfo {
+
+    private final QName componentType;
+    private final QName componentQName;
+
+    public ArrayTypeInfo(Class clazz,
+            QName qName,
+            Class serializerClass,
+            Class deserializerClass,
+            boolean canSearchParents,
+            FieldDesc[] fields,
+            QName componentType,
+            QName componentQName) {
+        super(clazz, qName, serializerClass, deserializerClass, canSearchParents, fields);
+        this.componentType = componentType;
+        this.componentQName = componentQName;
+    }
+
+    public void register(TypeMapping typeMapping) {
+//        SerializerFactory ser = BaseSerializerFactory.createFactory(getSerFactoryClass(), getClazz(), getqName());
+//        ((ArraySerializerFactory)ser).setComponentType(componentType);
+//        ((ArraySerializerFactory)ser).setComponentQName(componentQName);
+//        DeserializerFactory deser = BaseDeserializerFactory.createFactory(getDeserFactoryClass(), getClazz(), getqName());
+//        ((ArrayDeserializerFactory)deser).setComponentType(componentType);
+
+        ArraySerializerFactory ser = new ArraySerializerFactory(componentType, componentQName);
+        ArrayDeserializerFactory deser = new ArrayDeserializerFactory();
+
+        typeMapping.register(getClazz(), getqName(), ser, deser);
+    }
+
+    public static class UpdatableArrayTypeInfo extends TypeInfo.UpdatableTypeInfo {
+        private QName componentType;
+        private QName componentQName;
+
+        public TypeInfo buildTypeInfo() {
+            if (null == clazz) {
+                throw new IllegalStateException("clazz is null");
+            } else if (null == qName) {
+                throw new IllegalStateException("qName is null");
+            } else if (null == serializerClass) {
+                throw new IllegalStateException("serializerClass is null");
+            } else if (null == deserializerClass) {
+                throw new IllegalStateException("deserializerClass is null");
+            } else if (null == fields) {
+                throw new IllegalStateException("fields is null");
+            }
+            return new ArrayTypeInfo(clazz, qName, serializerClass, deserializerClass, canSearchParents, fields, componentType, componentQName);
+        }
+
+
+        public QName getComponentType() {
+            return componentType;
+        }
+
+        public QName getComponentQName() {
+            return componentQName;
+        }
+
+        public void setComponentType(QName componentType) {
+            this.componentType = componentType;
+        }
+
+        public void setComponentQName(QName componentQName) {
+            this.componentQName = componentQName;
+        }
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisClientImpl.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,50 @@
+/**
+ *  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.openejb.server.axis.client;
+
+import org.apache.axis.EngineConfiguration;
+import org.apache.axis.MessageContext;
+import org.apache.axis.client.AxisClient;
+import org.apache.axis.client.Call;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.HandlerChain;
+import java.util.Map;
+
+public class AxisClientImpl extends AxisClient {
+    private final Map portNameToSEIFactoryMap;
+
+    public AxisClientImpl(EngineConfiguration engineConfiguration, Map portNameToSEIFactoryMap) {
+        super(engineConfiguration);
+        this.portNameToSEIFactoryMap = portNameToSEIFactoryMap;
+    }
+
+    protected HandlerChain getJAXRPChandlerChain(MessageContext context) {
+        QName portQName = (QName) context.getProperty(Call.WSDL_PORT_NAME);
+        if (portQName == null) {
+            return null;
+        }
+        String portName = portQName.getLocalPart();
+
+        SeiFactory seiFactory = (SeiFactory) portNameToSEIFactoryMap.get(portName);
+        if (seiFactory == null) {
+            return null;
+        }
+        HandlerChain handlerChain = seiFactory.createHandlerChain();
+        return handlerChain;
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/AxisServiceReference.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,117 @@
+/**
+ *  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.openejb.server.axis.client;
+
+import net.sf.cglib.proxy.Callback;
+import net.sf.cglib.proxy.Enhancer;
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.NoOp;
+import net.sf.cglib.reflect.FastClass;
+import net.sf.cglib.reflect.FastConstructor;
+import org.apache.axis.client.Service;
+import org.apache.openejb.core.ivm.naming.Reference;
+
+import javax.naming.NamingException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Iterator;
+import java.util.Map;
+
+public class AxisServiceReference extends Reference {
+    private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new Class[]{Map.class, Map.class};
+
+    private String serviceInterfaceClassName;
+    private Map seiPortNameToFactoryMap;
+    private Map seiClassNameToFactoryMap;
+    private ClassLoader classLoader;
+
+    private FastConstructor serviceConstructor;
+    private Callback[] methodInterceptors;
+    private Class enhancedServiceClass;
+
+    public AxisServiceReference(String serviceInterfaceClassName, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap) {
+        this.serviceInterfaceClassName = serviceInterfaceClassName;
+        this.seiPortNameToFactoryMap = seiPortNameToFactoryMap;
+        this.seiClassNameToFactoryMap = seiClassNameToFactoryMap;
+    }
+
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public Object getObject() throws NamingException {
+        Object serviceInstance = createServiceInterfaceProxy(serviceInterfaceClassName, seiPortNameToFactoryMap, seiClassNameToFactoryMap, classLoader);
+        return serviceInstance;
+    }
+
+    private Object createServiceInterfaceProxy(String serviceInterfaceClassName, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, ClassLoader classLoader) throws NamingException {
+        boolean initialize = (this.serviceConstructor == null);
+
+        if (initialize) {
+            Class serviceInterface;
+            try {
+                serviceInterface = classLoader.loadClass(serviceInterfaceClassName);
+            } catch (ClassNotFoundException e) {
+                throw (NamingException) new NamingException("Could not load service interface class " + serviceInterfaceClassName).initCause(e);
+            }
+
+            // create method interceptors
+            Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
+            this.methodInterceptors = new Callback[]{NoOp.INSTANCE, callback};
+
+            // create service class
+            Enhancer enhancer = new Enhancer();
+            enhancer.setClassLoader(classLoader);
+            enhancer.setSuperclass(ServiceImpl.class);
+            enhancer.setInterfaces(new Class[]{serviceInterface});
+            enhancer.setCallbackFilter(new NoOverrideCallbackFilter(Service.class));
+            enhancer.setCallbackTypes(new Class[]{NoOp.class, MethodInterceptor.class});
+            enhancer.setUseFactory(false);
+            enhancer.setUseCache(false);
+            this.enhancedServiceClass = enhancer.createClass();
+
+            // get constructor
+            this.serviceConstructor = FastClass.create(this.enhancedServiceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
+        }
+
+        // associate the method interceptors with the generated service class on the current thread
+        Enhancer.registerCallbacks(this.enhancedServiceClass, this.methodInterceptors);
+
+        Object[] arguments = new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap};
+
+        Object serviceInstance = null;
+
+        try {
+            serviceInstance = this.serviceConstructor.newInstance(arguments);
+        } catch (InvocationTargetException e) {
+            throw (NamingException) new NamingException("Could not construct service instance").initCause(e.getTargetException());
+        }
+
+        if (initialize) {
+            for (Iterator iterator = seiPortNameToFactoryMap.values().iterator(); iterator.hasNext();) {
+                SeiFactoryImpl seiFactory = (SeiFactoryImpl) iterator.next();
+                try {
+                    seiFactory.initialize(serviceInstance, classLoader);
+                } catch (ClassNotFoundException e) {
+                    throw (NamingException) new NamingException("Could not load service interface class; " + e.getMessage()).initCause(e);
+                }
+            }
+        }
+
+        return serviceInstance;
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpoint.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,105 @@
+/**
+ *  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.openejb.server.axis.client;
+
+import java.net.URL;
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.NoEndPointException;
+import org.apache.axis.client.Call;
+import org.apache.axis.client.Service;
+
+public class GenericServiceEndpoint extends org.apache.axis.client.Stub {
+    public GenericServiceEndpoint(QName portQName, Service service, URL location) {
+        this.service = service;
+        cachedEndpoint = location;
+        cachedPortName = portQName;
+
+    }
+
+    Call createCall() throws java.rmi.RemoteException {
+        try {
+            org.apache.axis.client.Call _call =
+                    (org.apache.axis.client.Call) service.createCall();
+            if (super.maintainSessionSet) {
+                _call.setMaintainSession(super.maintainSession);
+            }
+            if (super.cachedUsername != null) {
+                _call.setUsername(super.cachedUsername);
+            }
+            if (super.cachedPassword != null) {
+                _call.setPassword(super.cachedPassword);
+            }
+            if (super.cachedEndpoint != null) {
+                _call.setTargetEndpointAddress(super.cachedEndpoint);
+            }
+            if (super.cachedTimeout != null) {
+                _call.setTimeout(super.cachedTimeout);
+            }
+            if (super.cachedPortName != null) {
+                _call.setPortName(super.cachedPortName);
+            }
+            java.util.Enumeration keys = super.cachedProperties.keys();
+            while (keys.hasMoreElements()) {
+                java.lang.String key = (java.lang.String) keys.nextElement();
+                _call.setProperty(key, super.cachedProperties.get(key));
+            }
+            // All the type mapping information is registered
+            // when the first call is made.
+            // The type mapping information is actually registered in
+            // the TypeMappingRegistry of the service, which
+            // is the reason why registration is only needed for the first call.
+            //TODO figure out if this can be done during deployment!
+//            synchronized (this) {
+//                if (firstCall()) {
+//                    // must set encoding style before registering serializers
+//                    //TODO these constants probably need to be parameters of GSE.
+//                    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+////                    _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
+//                    //override unsigned long mapping
+//                    _call.registerTypeMapping(BigInteger.class,
+//                            Constants.XSD_UNSIGNEDLONG,
+//                            new SimpleSerializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG),
+//                            new SimpleDeserializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG));
+//                    _call.registerTypeMapping(URI.class,
+//                            Constants.XSD_ANYURI,
+//                            new SimpleSerializerFactory(URI.class, Constants.XSD_ANYURI),
+//                            new SimpleDeserializerFactory(URI.class, Constants.XSD_ANYURI));
+//                    for (Iterator iterator = typeInfo.iterator(); iterator.hasNext();) {
+//                        TypeInfo info = (TypeInfo) iterator.next();
+//                        _call.registerTypeMapping(info.getClazz(), info.getqName(), info.getSerFactoryClass(), info.getDeserFactoryClass(), false);
+//                    }
+//                }
+//            }
+            return _call;
+        } catch (java.lang.Throwable t) {
+            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", t);
+        }
+    }
+
+    void checkCachedEndpoint() throws NoEndPointException {
+        if (cachedEndpoint == null) {
+            throw new NoEndPointException();
+        }
+    }
+
+    void setUpCall(Call call) throws AxisFault {
+        setRequestHeaders(call);
+        setAttachments(call);
+    }
+}

Added: openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpointWrapper.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpointWrapper.java?rev=591858&view=auto
==============================================================================
--- openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpointWrapper.java (added)
+++ openejb/trunk/openejb3/server/openejb-axis/src/main/java/org/apache/openejb/server/axis/client/GenericServiceEndpointWrapper.java Sun Nov  4 14:41:49 2007
@@ -0,0 +1,137 @@
+/**
+ *  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.openejb.server.axis.client;
+
+import org.apache.axis.NoEndPointException;
+import org.apache.axis.client.Call;
+import org.apache.axis.message.SOAPHeaderElement;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Stub;
+import java.util.Iterator;
+
+public class GenericServiceEndpointWrapper implements Stub {
+    private final GenericServiceEndpoint genericServiceEndpoint;
+
+    public GenericServiceEndpointWrapper(GenericServiceEndpoint genericServiceEndpoint) {
+        this.genericServiceEndpoint = genericServiceEndpoint;
+    }
+
+    public void _setProperty(String s, Object o) {
+        genericServiceEndpoint._setProperty(s, o);
+    }
+
+    public Object _getProperty(String s) {
+        return genericServiceEndpoint._getProperty(s);
+    }
+
+    public Object removeProperty(String s) {
+        return genericServiceEndpoint.removeProperty(s);
+    }
+
+    public Iterator _getPropertyNames() {
+        return genericServiceEndpoint._getPropertyNames();
+    }
+
+    public void setUsername(String s) {
+        genericServiceEndpoint.setUsername(s);
+    }
+
+    public String getUsername() {
+        return genericServiceEndpoint.getUsername();
+    }
+
+    public void setPassword(String s) {
+        genericServiceEndpoint.setPassword(s);
+    }
+
+    public String getPassword() {
+        return genericServiceEndpoint.getPassword();
+    }
+
+    public int getTimeout() {
+        return genericServiceEndpoint.getTimeout();
+    }
+
+    public void setTimeout(int i) {
+        genericServiceEndpoint.setTimeout(i);
+    }
+
+    public QName getPortName() {
+        return genericServiceEndpoint.getPortName();
+    }
+
+    public void setPortName(QName qName) {
+        genericServiceEndpoint.setPortName(qName);
+    }
+
+    public void setPortName(String s) {
+        genericServiceEndpoint.setPortName(s);
+    }
+
+    public void setMaintainSession(boolean b) {
+        genericServiceEndpoint.setMaintainSession(b);
+    }
+
+    public void setHeader(String s, String s1, Object o) {
+        genericServiceEndpoint.setHeader(s, s1, o);
+    }
+
+    public void setHeader(SOAPHeaderElement soapHeaderElement) {
+        genericServiceEndpoint.setHeader(soapHeaderElement);
+    }
+
+    public void extractAttachments(Call call) {
+        genericServiceEndpoint.extractAttachments(call);
+    }
+
+    public void addAttachment(Object o) {
+        genericServiceEndpoint.addAttachment(o);
+    }
+
+    public SOAPHeaderElement getHeader(String s, String s1) {
+        return genericServiceEndpoint.getHeader(s, s1);
+    }
+
+    public SOAPHeaderElement getResponseHeader(String s, String s1) {
+        return genericServiceEndpoint.getResponseHeader(s, s1);
+    }
+
+    public SOAPHeaderElement[] getHeaders() {
+        return genericServiceEndpoint.getHeaders();
+    }
+
+    public SOAPHeaderElement[] getResponseHeaders() {
+        return genericServiceEndpoint.getResponseHeaders();
+    }
+
+    public Object[] getAttachments() {
+        return genericServiceEndpoint.getAttachments();
+    }
+
+    public void clearHeaders() {
+        genericServiceEndpoint.clearHeaders();
+    }
+
+    public void clearAttachments() {
+        genericServiceEndpoint.clearAttachments();
+    }
+
+    void checkCachedEndpoint() throws NoEndPointException {
+        genericServiceEndpoint.checkCachedEndpoint();
+    }
+}



Mime
View raw message