You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/12/04 00:45:02 UTC

svn commit: r723148 [2/2] - in /geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests: ./ mtom-ear/ mtom-ear/src/ mtom-ear/src/main/ mtom-ear/src/main/resources/ mtom-ear/src/main/resources/META-INF/ mtom-ear/src/test/ mtom-ear/src/tes...

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,81 @@
+/**
+ * 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.echo;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for helloResponse complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="helloResponse">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="return" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "helloResponse", namespace = "http://geronimo.apache.org/echo", propOrder = {
+    "_return"
+})
+public class HelloResponse {
+
+    @XmlElement(name = "return", required = true)
+    protected String _return;
+
+    /**
+     * Gets the value of the return property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getReturn() {
+        return _return;
+    }
+
+    /**
+     * Sets the value of the return property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setReturn(String value) {
+        this._return = value;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/HelloResponse.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,162 @@
+/**
+ * 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.echo;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.apache.geronimo.echo package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _EchoBytes_QNAME = new QName("http://geronimo.apache.org/echo", "echoBytes");
+    private final static QName _EchoImage_QNAME = new QName("http://geronimo.apache.org/echo", "echoImage");
+    private final static QName _EchoBytesResponse_QNAME = new QName("http://geronimo.apache.org/echo", "echoBytesResponse");
+    private final static QName _EchoImageResponse_QNAME = new QName("http://geronimo.apache.org/echo", "echoImageResponse");
+    private final static QName _Hello_QNAME = new QName("http://geronimo.apache.org/echo", "hello");
+    private final static QName _HelloResponse_QNAME = new QName("http://geronimo.apache.org/echo", "helloResponse");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.geronimo.echo
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link EchoImageResponse }
+     * 
+     */
+    public EchoImageResponse createEchoImageResponse() {
+        return new EchoImageResponse();
+    }
+
+    /**
+     * Create an instance of {@link EchoImage }
+     * 
+     */
+    public EchoImage createEchoImage() {
+        return new EchoImage();
+    }
+
+    /**
+     * Create an instance of {@link EchoBytes }
+     * 
+     */
+    public EchoBytes createEchoBytes() {
+        return new EchoBytes();
+    }
+
+    /**
+     * Create an instance of {@link EchoBytesResponse }
+     * 
+     */
+    public EchoBytesResponse createEchoBytesResponse() {
+        return new EchoBytesResponse();
+    }
+
+    /**
+     * Create an instance of {@link HelloResponse }
+     * 
+     */
+    public HelloResponse createHelloResponse() {
+        return new HelloResponse();
+    }
+
+    /**
+     * Create an instance of {@link Hello }
+     * 
+     */
+    public Hello createHello() {
+        return new Hello();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link EchoBytes }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "echoBytes")
+    public JAXBElement<EchoBytes> createEchoBytes(EchoBytes value) {
+        return new JAXBElement<EchoBytes>(_EchoBytes_QNAME, EchoBytes.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link EchoImage }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "echoImage")
+    public JAXBElement<EchoImage> createEchoImage(EchoImage value) {
+        return new JAXBElement<EchoImage>(_EchoImage_QNAME, EchoImage.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link EchoBytesResponse }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "echoBytesResponse")
+    public JAXBElement<EchoBytesResponse> createEchoBytesResponse(EchoBytesResponse value) {
+        return new JAXBElement<EchoBytesResponse>(_EchoBytesResponse_QNAME, EchoBytesResponse.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link EchoImageResponse }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "echoImageResponse")
+    public JAXBElement<EchoImageResponse> createEchoImageResponse(EchoImageResponse value) {
+        return new JAXBElement<EchoImageResponse>(_EchoImageResponse_QNAME, EchoImageResponse.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Hello }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "hello")
+    public JAXBElement<Hello> createHello(Hello value) {
+        return new JAXBElement<Hello>(_Hello_QNAME, Hello.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link HelloResponse }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/echo", name = "helloResponse")
+    public JAXBElement<HelloResponse> createHelloResponse(HelloResponse value) {
+        return new JAXBElement<HelloResponse>(_HelloResponse_QNAME, HelloResponse.class, null, value);
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/ObjectFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://geronimo.apache.org/echo")
+package org.apache.geronimo.echo;
+

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/echo/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,162 @@
+/**
+ * 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.jaxws.mtom;
+
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.MTOMFeature;
+
+import junit.framework.Assert;
+
+import org.apache.geronimo.echo.Echo;
+
+public abstract class TestServlet extends HttpServlet {
+
+    protected String address;
+    protected Service service;
+
+    @Override
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        String testName = request.getParameter("test");
+        if (testName == null || !testName.startsWith("test")) {
+            throw new ServletException("Invalid test name");
+        }
+        Method testMethod = null;
+        try {
+            testMethod = getClass().getMethod(testName, new Class[] {});
+        } catch (Exception e1) {
+            throw new ServletException("No such test: " + testName);
+        }
+        try {
+            testMethod.invoke(this, (Object[]) null);
+        } catch (IllegalArgumentException e) {
+            throw new ServletException("Error invoking test: " + e.getMessage());
+        } catch (IllegalAccessException e) {
+            throw new ServletException("Error invoking test: " + e.getMessage());
+        } catch (InvocationTargetException e) {
+            Throwable root = e.getTargetException();
+            ServletException ex = new ServletException("Test '" + testName + "' failed");
+            ex.initCause(root);
+            throw ex;
+        }
+        response.setContentType("text/plain");
+        response.getWriter().println("Test '" + testName + "' passed");
+    }
+
+    public void testEchoBytesWithMTOMSupport() throws Exception {
+        testEchoBytes(true);
+    }
+
+    public void testEchoBytesWithoutMTOMSupport() throws Exception {
+        testEchoBytes(false);
+    }
+
+    private void testEchoBytes(boolean mtomSupport) throws Exception {
+        Echo echo = null;
+        if (mtomSupport)
+            echo = service.getPort(Echo.class, new MTOMFeature());
+        else
+            echo = service.getPort(Echo.class);
+
+        byte[] expectedBytes = loadImageAsBytes();
+        byte[] echoBytes = echo.echoBytes(mtomSupport, expectedBytes);
+        Assert.assertEquals(expectedBytes.length, echoBytes.length);
+        for (int i=0;i<expectedBytes.length;i++) {
+            Assert.assertEquals("" + i, expectedBytes[i], echoBytes[i]);
+        }
+    }
+
+    public void testEchoImageWithMTOMSupport() throws Exception {
+        testEchoImage(true);
+    }
+
+    public void testEchoImageWithoutMTOMSupport() throws Exception {
+        testEchoImage(false);
+    }
+
+    private void testEchoImage(boolean mtomSupport) throws Exception {
+        Echo echo = null;
+        if (mtomSupport)
+            echo = service.getPort(Echo.class, new MTOMFeature());
+        else
+            echo = service.getPort(Echo.class);
+
+        Image expectedImage = loadImage();
+        Image echoImage = echo.echoImage(mtomSupport, expectedImage);
+        byte[] actualImageBytes = convertImagetoBytes(echoImage);
+        byte[] expectedImageBytes = convertImagetoBytes(expectedImage);
+        Assert.assertEquals(expectedImageBytes.length, actualImageBytes.length);
+        for (int i=0; i<expectedImageBytes.length; i++) {
+            Assert.assertEquals("" + i, expectedImageBytes[i], actualImageBytes[i]);
+        }
+    }
+
+    private byte[] loadImageAsBytes() throws Exception {
+        ByteArrayOutputStream imageBytes = new ByteArrayOutputStream();
+        InputStream in = null;
+        int iCurrentReadBytes = -1;
+        byte[] bytesBuffer = new byte[512];
+        try {
+            in = getClass().getResourceAsStream("/image.jpg");
+            while ((iCurrentReadBytes = in.read(bytesBuffer)) != -1)
+                imageBytes.write(bytesBuffer, 0, iCurrentReadBytes);
+            return imageBytes.toByteArray();
+        } finally {
+            if (in != null)
+                try {
+                    in.close();
+                } catch (Exception e) {
+                }
+        }
+    }
+    
+    private Image loadImage() throws Exception {
+        URL url = this.getClass().getResource("/image.jpg");
+        return ImageIO.read(url);
+    }
+
+    private byte[] convertImagetoBytes(Image image) throws Exception {
+        ByteArrayOutputStream imageBytes = new ByteArrayOutputStream();
+        ImageIO.write((BufferedImage)image, "jpg", imageBytes);
+        return imageBytes.toByteArray();
+    }
+
+    protected void updateAddress() {
+        Echo echo = service.getPort(Echo.class);
+        BindingProvider binding = (BindingProvider) echo;
+        this.address = (String) binding.getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        System.out.println("Set address: " + this.address);
+    }
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,39 @@
+/**
+ * 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.jaxws.mtom;
+
+import javax.annotation.PostConstruct;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+
+public class TestServletEJB extends TestServlet {
+
+    private static final long serialVersionUID = -4549214200709703333L;
+    @WebServiceRef(name = "services/ejb/Echo")
+    private Service myService;
+
+    @PostConstruct
+    private void myInit() {
+
+        this.service = myService;
+        updateAddress();
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletEJB.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,38 @@
+/**
+ * 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.jaxws.mtom;
+
+import javax.annotation.PostConstruct;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+           
+
+public class TestServletWeb extends TestServlet {
+          
+    private static final long serialVersionUID = -1129892302183943809L;
+    @WebServiceRef(name = "services/Echo")
+    private Service myService;
+    
+    @PostConstruct
+    private void myInit() {
+        this.service = myService;
+        updateAddress();
+    }
+    
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/java/org/apache/geronimo/jaxws/mtom/TestServletWeb.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/resources/image.jpg
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/resources/image.jpg?rev=723148&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/resources/image.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,52 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+  <dep:environment>
+    <dep:moduleId>
+      <dep:groupId>${pom.groupId}</dep:groupId>
+      <dep:artifactId>${pom.artifactId}</dep:artifactId>
+      <dep:version>${version}</dep:version>
+      <dep:type>war</dep:type>
+    </dep:moduleId>
+  </dep:environment>
+
+ <context-root>/${pom.artifactId}</context-root> 
+
+ <service-ref>
+   <service-ref-name>services/Echo</service-ref-name>
+   <port>
+      <port-name>EchoPort</port-name>
+      <protocol>http</protocol>
+      <host>localhost</host>
+      <port>8080</port>
+      <uri>/mtom-war/echo</uri>
+   </port>
+ </service-ref>
+ 
+  <service-ref>
+   <service-ref-name>services/ejb/Echo</service-ref-name>
+   <port>
+      <port-name>EchoPort</port-name>
+      <protocol>http</protocol>
+      <host>localhost</host>
+      <port>8080</port>
+      <uri>/EchoService/Echo</uri>
+   </port>
+ </service-ref>
+
+</web-app>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,62 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
+         version="2.5"
+        >
+
+    <display-name>JAX-WS MTOM Test</display-name>
+
+    <servlet>
+        <display-name>TestServletWeb</display-name>
+        <servlet-name>TestServletWeb</servlet-name>
+        <servlet-class>org.apache.geronimo.jaxws.mtom.TestServletWeb</servlet-class>
+        <load-on-startup>0</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>TestServletWeb</servlet-name>
+        <url-pattern>/test-web</url-pattern>
+    </servlet-mapping>
+    
+    <servlet>
+        <display-name>TestServletEJB</display-name>
+        <servlet-name>TestServletEJB</servlet-name>
+        <servlet-class>org.apache.geronimo.jaxws.mtom.TestServletEJB</servlet-class>
+        <load-on-startup>0</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>TestServletEJB</servlet-name>
+        <url-pattern>/test-ejb</url-pattern>
+    </servlet-mapping>
+    
+    <service-ref>
+       <service-ref-name>services/Echo</service-ref-name>
+       <service-interface>javax.xml.ws.Service</service-interface>
+       <wsdl-file>WEB-INF/wsdl/echo.wsdl</wsdl-file>
+   </service-ref>
+   
+   <service-ref>
+       <service-ref-name>services/ejb/Echo</service-ref-name>
+       <service-interface>javax.xml.ws.Service</service-interface>
+       <wsdl-file>WEB-INF/wsdl/echo.wsdl</wsdl-file>
+   </service-ref>
+   
+</web-app>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl Wed Dec  3 15:45:00 2008
@@ -0,0 +1,142 @@
+<?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.
+-->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://geronimo.apache.org/echo" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    name="EchoService" targetNamespace="http://geronimo.apache.org/echo">
+    <wsdl:types>
+        <xs:schema xmlns:tns="http://geronimo.apache.org/echo" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" attributeFormDefault="unqualified"
+            elementFormDefault="unqualified" targetNamespace="http://geronimo.apache.org/echo">
+            <xs:element name="hello" type="tns:hello"/>
+            <xs:element name="helloResponse" type="tns:helloResponse"/>
+            <xs:element name="echoBytes" type="tns:echoBytes"/>
+            <xs:element name="echoBytesResponse" type="tns:echoBytesResponse"/>
+            <xs:element name="echoImage" type="tns:echoImage"/>
+            <xs:element name="echoImageResponse" type="tns:echoImageResponse"/>
+            <xs:complexType name="hello">
+                <xs:sequence>
+                    <xs:element name="arg0" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="helloResponse">
+                <xs:sequence>
+                    <xs:element name="return" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="echoBytes">
+                <xs:sequence>
+                    <xs:element name="useMTOM" type="xs:boolean"/>
+                    <xs:element name="bytes" type="xs:base64Binary"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="echoBytesResponse">
+                <xs:sequence>
+                    <xs:element name="return" type="xs:base64Binary"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="echoImage">
+                <xs:sequence>
+                    <xs:element name="useMTOM" type="xs:boolean"/>
+                    <xs:element name="imageBytes" type="xs:base64Binary" xmime:expectedContentTypes="image/jpeg"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="echoImageResponse">
+                <xs:sequence>
+                    <xs:element name="return" type="xs:base64Binary" xmime:expectedContentTypes="image/jpeg"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="hello">
+        <wsdl:part element="tns:hello" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="helloResponse">
+        <wsdl:part element="tns:helloResponse" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="echoBytesResponse">
+        <wsdl:part element="tns:echoBytesResponse" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="echoBytes">
+        <wsdl:part element="tns:echoBytes" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="echoImageResponse">
+        <wsdl:part element="tns:echoImageResponse" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="echoImage">
+        <wsdl:part element="tns:echoImage" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="Echo">
+        <wsdl:operation name="hello">
+            <wsdl:input message="tns:hello">
+            </wsdl:input>
+            <wsdl:output message="tns:helloResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="echoBytes">
+            <wsdl:input message="tns:echoBytes">
+            </wsdl:input>
+            <wsdl:output message="tns:echoBytesResponse">
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="echoImage">
+            <wsdl:input message="tns:echoImage">
+            </wsdl:input>
+            <wsdl:output message="tns:echoImageResponse">
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="EchoServiceSoapBinding" type="tns:Echo">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="hello">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="echoBytes">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="echoImage">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="EchoService">
+        <wsdl:port binding="tns:EchoServiceSoapBinding" name="EchoPort">
+            <soap:address location="http://localhost:8080/mtom-war/echo"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-test-war/src/main/webapp/WEB-INF/wsdl/echo.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,54 @@
+<?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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>jaxws-mtom-tests</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>mtom-war</artifactId>
+    <name>Geronimo TestSuite :: WebServices TestSuite :: JAX-WS MTOM WAR</name>
+    <packaging>war</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,121 @@
+/**
+ * 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.jaxws.test;
+
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import junit.framework.Assert;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AttachmentHandler implements SOAPHandler<SOAPMessageContext> {
+
+    private static final Logger LOG = LoggerFactory.getLogger(AttachmentHandler.class);
+
+    public void close(MessageContext messageContext) {
+        // TODO Auto-generated method stub
+    }
+
+    public boolean handleFault(SOAPMessageContext soapMessageContext) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public boolean handleMessage(SOAPMessageContext soapMessageContext) {
+        boolean outbound = (Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+        SOAPMessage soapMessage = soapMessageContext.getMessage();
+        try {
+            if (outbound) {
+                //MTOM is always enabled
+                Element xopInclude = findElementNode(soapMessage.getSOAPBody(), "include");
+                //include element should be find in the soap message
+                Assert.assertNotNull(xopInclude);
+                //Attachment size should be 1
+                int attachments = soapMessage.countAttachments();
+                if (attachments == 0) {
+                    LOG.warn("Expected 1 attachment but got 0");
+                } else if (attachments == 1) {
+                    // that's what we expect
+                } else {
+                    Assert.fail("Unexpected number of attachments: " + attachments);
+                }
+            } else {
+                Element useMTOMElement = findElementNode(soapMessage.getSOAPBody(), "useMTOM");
+                if (useMTOMElement != null) {
+                    String sUseMTOM = getSubTextChildValue(useMTOMElement);
+                    //If the useMTOM is true, the attachment size should be 1, or the attachment size should be 0
+                    if (Boolean.parseBoolean(sUseMTOM))
+                        Assert.assertEquals(soapMessage.countAttachments(), 1);
+                    else
+                        Assert.assertEquals(soapMessage.countAttachments(), 0);
+                }
+            }
+        } catch (Exception e) {
+            return false;
+        }
+        return true;
+    }
+
+    private String getSubTextChildValue(Element element) {
+        NodeList childrenList = element.getChildNodes();
+        if (childrenList.getLength() == 0)
+            return null;
+        for (int i = 0; i < childrenList.getLength(); i++) {
+            Node node = childrenList.item(i);
+            if (node.getNodeType() == Node.TEXT_NODE)
+                return ((Text) node).getNodeValue();
+        }
+        return null;
+    }
+
+    private Element findElementNode(Element rootElement, String elementName) {
+        if (rootElement.getLocalName().equalsIgnoreCase(elementName))
+            return rootElement;
+        NodeList childrenList = rootElement.getChildNodes();
+        if (childrenList.getLength() > 0) {
+            for (int i = 0; i < childrenList.getLength(); i++) {
+                Node node = childrenList.item(i);
+                if (node.getNodeType() == Node.ELEMENT_NODE) {
+                    Element findElement = findElementNode((Element) node, elementName);
+                    if (findElement != null)
+                        return findElement;
+                }
+            }
+        }
+        return null;
+    }
+
+    public Set<QName> getHeaders() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/AttachmentHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java Wed Dec  3 15:45:00 2008
@@ -0,0 +1,67 @@
+/**
+ * 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.jaxws.test;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.jws.HandlerChain;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.SOAPBinding;
+
+@WebService(serviceName = "EchoService", portName = "EchoPort", name = "Echo", targetNamespace = "http://geronimo.apache.org/echo")
+@MTOM(enabled = true)
+@HandlerChain(file = "handlers.xml")
+@BindingType(value = SOAPBinding.SOAP11HTTP_BINDING)
+public class EchoImpl {
+
+    @Resource
+    private WebServiceContext context;
+
+    public String hello(String name) {
+        return "Hello, " + name;
+    }
+
+    public byte[] echoBytes(
+            @WebParam(name = "useMTOM", targetNamespace = "") boolean useMTOM,
+            @WebParam(name = "bytes", targetNamespace = "") byte[] bytes) {
+        return bytes;
+    }
+
+    public byte[] echoImage(
+            @WebParam(name = "useMTOM", targetNamespace = "") boolean useMTOM,
+            @WebParam(name = "imageBytes", targetNamespace = "") byte[] imageBytes) {
+        return imageBytes;
+    }
+
+    @PostConstruct
+    private void myInit() {
+        System.out.println(this + " PostConstruct");
+    }
+
+    @PreDestroy()
+    private void myDestroy() {
+        System.out.println(this + " PreDestroy");
+    }
+}

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/EchoImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+
+<jws:handler-chains xmlns:jws="http://java.sun.com/xml/ns/javaee">
+  <jws:handler-chain>
+    <jws:handler>
+      <jws:handler-name>Handler</jws:handler-name>
+      <jws:handler-class>org.apache.geronimo.jaxws.test.AttachmentHandler</jws:handler-class>
+    </jws:handler>    
+  </jws:handler-chain>
+</jws:handler-chains>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/java/org/apache/geronimo/jaxws/test/handlers.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,30 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+  <dep:environment>
+    <dep:moduleId>
+      <dep:groupId>${pom.groupId}</dep:groupId>
+      <dep:artifactId>${pom.artifactId}</dep:artifactId>
+      <dep:version>${version}</dep:version>
+      <dep:type>war</dep:type>
+    </dep:moduleId>
+  </dep:environment>
+
+ <context-root>/${pom.artifactId}</context-root> 
+
+</web-app>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Copyright 2006 The Apache Software Foundation
+Licensed  under the  Apache License,  Version 2.0  (the "License");
+you may not use  this file  except in  compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed  under the  License is distributed on an "AS IS" BASIS,
+WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
+         version="2.5"
+        >
+
+    <display-name>JAX-WS MTOM Support Test</display-name>
+
+    <servlet>
+        <display-name>EchoServlet</display-name>
+        <servlet-name>EchoServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.jaxws.test.EchoImpl</servlet-class>
+        <load-on-startup>0</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>EchoServlet</servlet-name>
+        <url-pattern>/echo</url-pattern>
+    </servlet-mapping>
+       
+</web-app>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/mtom-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml?rev=723148&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml (added)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml Wed Dec  3 15:45:00 2008
@@ -0,0 +1,88 @@
+<?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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+    <modelVersion>4.0.0</modelVersion> 
+    
+    <parent>
+        <artifactId>webservices-testsuite</artifactId>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>jaxws-mtom-tests</artifactId>
+    <packaging>pom</packaging>
+    <name>Geronimo TestSuite :: WebServices TestSuite :: JAX-WS MTOM Support</name>
+
+    <description>Geronimo JEE5 Webservices MTOM tests</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-saaj_1.3_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <modules>
+        <module>mtom-test-war</module>
+        <module>mtom-war</module>
+        <module>mtom-ejb</module>
+        <module>mtom-ear</module>
+    </modules>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-mtom-tests/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml