You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2018/11/11 19:22:55 UTC

svn commit: r1846359 - in /webservices/axiom/trunk: pom.xml samples/pom.xml samples/src/test/java/org/apache/axiom/samples/MTOMSample.java

Author: veithen
Date: Sun Nov 11 19:22:55 2018
New Revision: 1846359

URL: http://svn.apache.org/viewvc?rev=1846359&view=rev
Log:
Use JAX-WS RI instead of CXF.

Modified:
    webservices/axiom/trunk/pom.xml
    webservices/axiom/trunk/samples/pom.xml
    webservices/axiom/trunk/samples/src/test/java/org/apache/axiom/samples/MTOMSample.java

Modified: webservices/axiom/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/pom.xml?rev=1846359&r1=1846358&r2=1846359&view=diff
==============================================================================
--- webservices/axiom/trunk/pom.xml (original)
+++ webservices/axiom/trunk/pom.xml Sun Nov 11 19:22:55 2018
@@ -481,14 +481,9 @@
                 <version>2.1.0</version>
             </dependency>
             <dependency>
-                <groupId>org.apache.cxf</groupId>
-                <artifactId>cxf-rt-frontend-jaxws</artifactId>
-                <version>3.2.6</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.cxf</groupId>
-                <artifactId>cxf-rt-transports-http-jetty</artifactId>
-                <version>3.2.6</version>
+                <groupId>com.sun.xml.ws</groupId>
+                <artifactId>jaxws-rt</artifactId>
+                <version>2.3.1</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.felix</groupId>
@@ -540,16 +535,6 @@
                 <artifactId>jaxb-runtime</artifactId>
                 <version>2.3.1</version>
             </dependency>
-            <dependency>
-                <groupId>javax.jws</groupId>
-                <artifactId>jsr181-api</artifactId>
-                <version>1.0-MR1</version>
-            </dependency>
-            <dependency>
-                <groupId>javax.xml.ws</groupId>
-                <artifactId>jaxws-api</artifactId>
-                <version>2.3.1</version>
-            </dependency>
         </dependencies>
     </dependencyManagement>
 

Modified: webservices/axiom/trunk/samples/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/samples/pom.xml?rev=1846359&r1=1846358&r2=1846359&view=diff
==============================================================================
--- webservices/axiom/trunk/samples/pom.xml (original)
+++ webservices/axiom/trunk/samples/pom.xml Sun Nov 11 19:22:55 2018
@@ -72,28 +72,13 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>javax.jws</groupId>
-            <artifactId>jsr181-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.ws</groupId>
-            <artifactId>jaxws-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.glassfish.jaxb</groupId>
             <artifactId>jaxb-runtime</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxws</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <groupId>com.sun.xml.ws</groupId>
+            <artifactId>jaxws-rt</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>

Modified: webservices/axiom/trunk/samples/src/test/java/org/apache/axiom/samples/MTOMSample.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/samples/src/test/java/org/apache/axiom/samples/MTOMSample.java?rev=1846359&r1=1846358&r2=1846359&view=diff
==============================================================================
--- webservices/axiom/trunk/samples/src/test/java/org/apache/axiom/samples/MTOMSample.java (original)
+++ webservices/axiom/trunk/samples/src/test/java/org/apache/axiom/samples/MTOMSample.java Sun Nov 11 19:22:55 2018
@@ -52,19 +52,20 @@ public class MTOMSample extends TestCase
         OMElement fileId = soapFactory.createOMElement(new QName("fileId"), retrieveContent);
         fileId.setText(id);
         
-        // Use the java.net.URL API to connect to the service
+        // Use the java.net.URL API to connect to the service and send the request
         URLConnection connection = serviceURL.openConnection();
         connection.setDoOutput(true);
-        connection.addRequestProperty("Content-Type", "text/xml; charset=UTF-8");
-        OutputStream out = connection.getOutputStream();
-        // Send the request
         OMOutputFormat format = new OMOutputFormat();
+        format.setDoOptimize(true);
         format.setCharSetEncoding("UTF-8");
+        connection.addRequestProperty("Content-Type", format.getContentType());
+        OutputStream out = connection.getOutputStream();
         request.serialize(out, format);
         out.close();
         
         // Get the SOAP response
         InputStream in = connection.getInputStream();
+        System.out.println(connection.getContentType());
         MultipartBody multipartBody = MultipartBody.builder()
                 .setInputStream(in)
                 .setContentType(connection.getContentType())