Author: bmaxwell
Date: 2011-05-07 03:36:24 -0400 (Sat, 07 May 2011)
New Revision: 14309
Added:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ByteArrayDataSource.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml
Removed:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml
Modified:
stack/native/branches/jbossws-native-3.1.2/
stack/native/branches/jbossws-native-3.1.2/modules/core/
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBPAPP-6355] Fix unexpected bytes are serialized in MTOM attachment when the mime type is
text/xml
Property changes on: stack/native/branches/jbossws-native-3.1.2
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk:12502,13992
+ /stack/native/trunk:12502,13992,14181
Property changes on: stack/native/branches/jbossws-native-3.1.2/modules/core
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk/modules/core:12502,13992,14011
+ /stack/native/trunk/modules/core:12502,13992,14011,14181
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2011-05-06
22:34:04 UTC (rev 14308)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -102,12 +102,20 @@
public String addMtomAttachment(byte[] data, int offset, int length,
String mimeType, String elementNamespace, String
elementLocalName)
{
+
+ DataHandler dh = null;
+ String contentType = "application/octet-stream";
+ if (mimeType.contains("xml") || mimeType.contains("text") ||
mimeType.contains("html"))
+ {
+ contentType = mimeType;
+ ByteArrayDataSource ds = new ByteArrayDataSource(data, offset, length);
+ ds.setContentType(contentType);
+ dh = new DataHandler(ds);
+ } else {
+ dh = new DataHandler(data, contentType);
+ }
+
- if(true)
- mimeType = null; // ignore the mime type. otherwise the content handlers will
fail
-
- String contentType = mimeType != null ? mimeType :
"application/octet-stream";
- DataHandler dh = new DataHandler(data, contentType);
return addMtomAttachment(dh, elementNamespace, elementLocalName);
}
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ByteArrayDataSource.java
(from rev 14181,
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ByteArrayDataSource.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ByteArrayDataSource.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/ByteArrayDataSource.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,55 @@
+package org.jboss.ws.extensions.xop.jaxws;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.activation.DataSource;
+
+public class ByteArrayDataSource implements DataSource {
+ private String contentType;
+ private String name;
+ private byte[] data;
+ private int offset;
+ private int length;
+
+ public ByteArrayDataSource(byte[] data) {
+ this(data, 0, data.length);
+ }
+ public ByteArrayDataSource(byte[] data, String contentType) {
+ this(data, 0, data.length);
+ this.contentType = contentType;
+ }
+
+ public ByteArrayDataSource(byte[] data, int offset, int length) {
+ this.data = data;
+ this.offset = offset;
+ this.length = length;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public InputStream getInputStream() throws IOException {
+ return new ByteArrayInputStream(data, offset, length);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public OutputStream getOutputStream() throws IOException {
+ return null;
+ }
+
+}
Property changes on:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013
+ /stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013,14181
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2011-05-06
22:34:04 UTC (rev 14308)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2011-05-07
07:36:24 UTC (rev 14309)
@@ -756,14 +756,22 @@
</metainf>
</jar>
- <!-- jaxws-jbws3250 -->
- <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws3250.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3250/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include
name="org/jboss/test/ws/jaxws/jbws3250/*.class" />
- <exclude
name="org/jboss/test/ws/jaxws/jbws3250/*TestCase*.class" />
- </classes>
- </war>
+ <!-- jaxws-jbws3250 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3250.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3250/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3250/*.class"
/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws3250/*TestCase*.class" />
+ </classes>
+ </war>
+ <!-- jaxws-jbws3277 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3277.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3277/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3277/*.class"
/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws3277/*TestCase*.class" />
+ </classes>
+ </war>
+
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war"
webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws3277;
-
-import javax.jws.WebService;
-
-@WebService(name = "TestEndpoint", targetNamespace =
"http://ws.jboss.org/jbws3277")
-
-public interface Endpoint
-{
- public MTOMResponse echo(MTOMRequest message);
-
-}
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/Endpoint.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3277;
+
+import javax.jws.WebService;
+
+@WebService(name = "TestEndpoint", targetNamespace =
"http://ws.jboss.org/jbws3277")
+
+public interface Endpoint
+{
+ public MTOMResponse echo(MTOMRequest message);
+
+}
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws3277;
-
-import javax.jws.WebService;
-import javax.xml.ws.BindingType;
-
-
-@WebService(
- name = "TestEndpoint",
- targetNamespace = "http://ws.jboss.org/jbws3277",
- serviceName = "TestEndpointService",
- endpointInterface = "org.jboss.test.ws.jaxws.jbws3277.Endpoint")
-@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
-
-public class EndpointImpl implements Endpoint
-{
- public MTOMResponse echo(MTOMRequest message) {
- MTOMResponse response = new MTOMResponse();
- response.setResponseXML(message.getRequestXML());
- response.setResponse("text/xml mtom response");
- return response;
- }
-}
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/EndpointImpl.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3277;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+
+
+@WebService(
+ name = "TestEndpoint",
+ targetNamespace = "http://ws.jboss.org/jbws3277",
+ serviceName = "TestEndpointService",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws3277.Endpoint")
+@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+
+public class EndpointImpl implements Endpoint
+{
+ public MTOMResponse echo(MTOMRequest message) {
+ MTOMResponse response = new MTOMResponse();
+ response.setResponseXML(message.getRequestXML());
+ response.setResponse("text/xml mtom response");
+ return response;
+ }
+}
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws3277;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPBinding;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestSetup;
-import org.w3c.dom.Document;
-
-public class JBWS3277TestCase extends JBossWSTest
-{
- private String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws3277";
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS3277TestCase.class,
"jaxws-jbws3277.war");
- }
-
- public void testMtomSawpFile() throws Exception
- {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new
QName("http://ws.jboss.org/jbws3277",
"TestEndpointService");
- Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
- SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
- binding.setMTOMEnabled(true);
- File file =
JBossWSTestHelper.getResourceFile("jaxws/jbws3277/test-message.xml");
-
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- Document doc = docBuilder.parse(file);
- Source source = new DOMSource(doc);
-
- MTOMRequest request = new MTOMRequest();
- request.setRequestXML(source);
- request.setId("text/xml mtom request");
- MTOMResponse mtomResponse = port.echo(request);
- Assert.assertEquals("text/xml mtom response",
mtomResponse.getResponse());
- source = mtomResponse.getResponseXML();
-
- Transformer t =
javax.xml.transform.TransformerFactory.newInstance().newTransformer();
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- Result result = new StreamResult(os);
- t.transform(source, result);
- assertEquals(375, os.toByteArray().length);
- }
-
-}
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/JBWS3277TestCase.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3277;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+
+import junit.framework.Assert;
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Document;
+
+public class JBWS3277TestCase extends JBossWSTest
+{
+ private String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws3277";
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS3277TestCase.class,
"jaxws-jbws3277.war");
+ }
+
+ public void testMtomSawpFile() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new
QName("http://ws.jboss.org/jbws3277",
"TestEndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
+ binding.setMTOMEnabled(true);
+ File file =
JBossWSTestHelper.getResourceFile("jaxws/jbws3277/test-message.xml");
+
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ Document doc = docBuilder.parse(file);
+ Source source = new DOMSource(doc);
+
+ MTOMRequest request = new MTOMRequest();
+ request.setRequestXML(source);
+ request.setId("text/xml mtom request");
+ MTOMResponse mtomResponse = port.echo(request);
+ Assert.assertEquals("text/xml mtom response",
mtomResponse.getResponse());
+ source = mtomResponse.getResponseXML();
+
+ Transformer t =
javax.xml.transform.TransformerFactory.newInstance().newTransformer();
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ Result result = new StreamResult(os);
+ t.transform(source, result);
+ assertEquals(375, os.toByteArray().length);
+ }
+
+}
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws3277;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.transform.Source;
-
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "id",
- "requestXML"
-})
-@XmlRootElement(name = "MTOMRequest")
-public class MTOMRequest
-{
- @XmlElement(name = "Id", required = true)
- protected String id;
- @XmlElement(name = "RequestXML", required = true)
- @XmlMimeType("text/xml")
- protected Source requestXML;
-
- public Source getRequestXML() {
- return requestXML;
- }
-
- public void setRequestXML(Source value)
- {
- this.requestXML = value;
- }
-
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
-}
\ No newline at end of file
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMRequest.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3277;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "id",
+ "requestXML"
+})
+@XmlRootElement(name = "MTOMRequest")
+public class MTOMRequest
+{
+ @XmlElement(name = "Id", required = true)
+ protected String id;
+ @XmlElement(name = "RequestXML", required = true)
+ @XmlMimeType("text/xml")
+ protected Source requestXML;
+
+ public Source getRequestXML() {
+ return requestXML;
+ }
+
+ public void setRequestXML(Source value)
+ {
+ this.requestXML = value;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+}
\ No newline at end of file
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws3277;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlMimeType;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.transform.Source;
-
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "response",
- "responseXML"
-})
-@XmlRootElement(name = "MTOMResponse")
-public class MTOMResponse
-{
- @XmlElement(name = "Reponse", required = true)
- protected String response;
- @XmlElement(name = "ResponseXML", required = true)
- @XmlMimeType("text/xml")
- protected Source responseXML;
-
-
- public Source getResponseXML() {
- return responseXML;
- }
-
- public void setResponseXML(Source value)
- {
- this.responseXML = value;
- }
- public String getResponse()
- {
- return response;
- }
-
- public void setResponse(String value)
- {
- this.response = value;
- }
-
-}
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3277/MTOMResponse.java 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3277;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "response",
+ "responseXML"
+})
+@XmlRootElement(name = "MTOMResponse")
+public class MTOMResponse
+{
+ @XmlElement(name = "Reponse", required = true)
+ protected String response;
+ @XmlElement(name = "ResponseXML", required = true)
+ @XmlMimeType("text/xml")
+ protected Source responseXML;
+
+
+ public Source getResponseXML() {
+ return responseXML;
+ }
+
+ public void setResponseXML(Source value)
+ {
+ this.responseXML = value;
+ }
+ public String getResponse()
+ {
+ return response;
+ }
+
+ public void setResponse(String value)
+ {
+ this.response = value;
+ }
+
+}
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
-
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_4.xsd">
-
- <servlet>
- <servlet-name>TestEndpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.jbws3277.EndpointImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/WEB-INF/web.xml 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
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_4.xsd">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws3277.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Deleted:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml 2011-04-21
16:28:57 UTC (rev 14181)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml 2011-05-07
07:36:24 UTC (rev 14309)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
-<env:Header>
-<wsse:Security
xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
-</wsse:Security>
-</env:Header>
-<env:Body>
-<Foo
xmlns='http://www.jboss.org/jbossws'>
-<Body>
- jbossws
-</Body>
-</Foo>
-</env:Body>
-</env:Envelope>
Copied:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml
(from rev 14181,
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml)
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws3277/test-message.xml 2011-05-07
07:36:24 UTC (rev 14309)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+<env:Header>
+<wsse:Security
xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+</wsse:Security>
+</env:Header>
+<env:Body>
+<Foo
xmlns='http://www.jboss.org/jbossws'>
+<Body>
+ jbossws
+</Body>
+</Foo>
+</env:Body>
+</env:Envelope>