You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by th...@apache.org on 2005/06/30 12:53:41 UTC
svn commit: r202519 - in /webservices/axis/trunk/java/modules:
core/src/org/apache/axis/ samples/ samples/test/org/apache/axis/engine/
xml/ xml/src/org/apache/axis/om/
Author: thilina
Date: Thu Jun 30 03:53:39 2005
New Revision: 202519
URL: http://svn.apache.org/viewcvs?rev=202519&view=rev
Log:
Commiting MTOM Samples. MTOM echo Sample is working well.
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
webservices/axis/trunk/java/modules/samples/maven.xml
webservices/axis/trunk/java/modules/samples/project.xml
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/Echo.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java
webservices/axis/trunk/java/modules/xml/project.xml
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/MIMEOutputUtils.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMOutput.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Thu Jun 30 03:53:39 2005
@@ -169,6 +169,8 @@
public static final String ENABLE_REST = "enableREST";
// globally enable MTOM
public static final String ENABLE_MTOM = "enableMTOM";
+ public static final String ATTACHMENT_TEMP_DIR = "attachmentDIR";
+ public static final String CACHE_ATTACHMENTS = "cacheAttachments";
}
public static final String VALUE_TRUE = "true";
public static final String VALUE_FALSE = "false";
Modified: webservices/axis/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/maven.xml?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis/trunk/java/modules/samples/maven.xml Thu Jun 30 03:53:39 2005
@@ -33,7 +33,12 @@
<!-- Commons transport enabled enabled Repository -->
<mkdir dir="target/test-resources/commons-http-enabledRepository"/>
<copy file="test/org/apache/axis/engine/commons-http-enabled-axis2.xml"
- tofile="target/test-resources/commons-http-enabledRepository/axis2.xml"/>
+ tofile="target/test-resources/commons-http-enabledRepository/axis2.xml"/>
+
+ <!-- MTOM enabled Repository -->
+ <mkdir dir="target/test-resources/MTOM-enabledRepository"/>
+ <copy file="test/org/apache/axis/engine/MTOM-enabled-axis2.xml"
+ tofile="target/test-resources/MTOM-enabledRepository/axis2.xml"/>
</postGoal>
<postGoal name="test:test">
Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Thu Jun 30 03:53:39 2005
@@ -138,7 +138,8 @@
<exclude>**/*MailRequestResponseRawXMLTest.java</exclude>
<exclude>**/*EchoRawXMLChunckedTest.java</exclude>
<!-- <exclude>**/*CommonsHTTPEchoRawXMLTest.java</exclude> -->
- <exclude>**/*EchoRawMTOMTest.java</exclude>
+ <exclude>**/*EchoRawMTOMTest.java</exclude>
+ <exclude>**/*EchoRawMTOMToBase64Test.java</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/Echo.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/Echo.java?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/Echo.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/Echo.java Thu Jun 30 03:53:39 2005
@@ -51,5 +51,4 @@
omText.doOptimize(false);
return omEle;
}
-
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java Thu Jun 30 03:53:39 2005
@@ -15,9 +15,9 @@
*/
package org.apache.axis.engine;
-
-//todo
-
+/**
+ * @author <a href="mailto:thilina@opensource.lk">Thilina Gunarathne </a>
+ */
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLOutputFactory;
@@ -31,7 +31,6 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
-import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -45,20 +44,19 @@
import org.apache.commons.logging.LogFactory;
public class EchoRawMTOMTest extends TestCase {
- private EndpointReference targetEPR =
- new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:"
- + (UtilServer.TESTING_PORT+1)
- + "/axis/services/EchoXMLService/echoMTOMtoBase64");
- private Log log = LogFactory.getLog(getClass());
- private QName serviceName = new QName("EchoXMLService");
- private QName operationName = new QName("echoMTOMtoBase64");
- private QName transportName = new QName("http://localhost/my", "NullTransport");
+ private EndpointReference targetEPR =
+ new EndpointReference(AddressingConstants.WSA_TO,
+ "http://127.0.0.1:"
+ + (UtilServer.TESTING_PORT+1)
+ + "/axis/services/EchoXMLService/echoOMElement");
+private Log log = LogFactory.getLog(getClass());
+private QName serviceName = new QName("EchoXMLService");
+private QName operationName = new QName("echoOMElement");
+private QName transportName = new QName("http://localhost/my", "NullTransport");
private AxisConfiguration engineRegistry;
private MessageContext mc;
- //private Thread thisThread;
- // private SimpleHTTPServer sas;
+
private ServiceContext serviceContext;
private ServiceDescription service;
@@ -73,7 +71,7 @@
}
protected void setUp() throws Exception {
- UtilServer.start();
+ UtilServer.start(Constants.TESTING_PATH + "MTOM-enabledRepository");
service =
Utils.createSimpleService(serviceName,
Echo.class.getName(),
@@ -110,31 +108,14 @@
OMElement payload = createEnvelope();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
-
call.setTo(targetEPR);
call.set(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+// result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
call.close();
}
-
- /* public void testCorrectSOAPEnvelope() throws Exception {
-
- OMElement payload = createEnvelope();
-
- org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
-
- call.setTo(targetEPR);
- call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
-
- OMElement result =
- (OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- call.close();
- }*/
-
}
Modified: webservices/axis/trunk/java/modules/xml/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/project.xml?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/project.xml (original)
+++ webservices/axis/trunk/java/modules/xml/project.xml Thu Jun 30 03:53:39 2005
@@ -36,6 +36,7 @@
<exclude>**/*MTOMStAXSOAPModelBuilderTest.java</exclude>
<exclude>**/*ImageSampleTest.java</exclude>
<exclude>**/*MIMEHelperTest.java</exclude>
+ <exclude>**/*MIMEOutputUtilsTest.java</exclude>
</excludes>
<includes>
<include>**/*Test.java</include>
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/MIMEOutputUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/MIMEOutputUtils.java?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/MIMEOutputUtils.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/MIMEOutputUtils.java Thu Jun 30 03:53:39 2005
@@ -66,7 +66,7 @@
}
}
- private static MimeBodyPart createMimeBodyPart(OMText node)
+ protected static MimeBodyPart createMimeBodyPart(OMText node)
throws MessagingException {
MimeBodyPart mimeBodyPart = new MimeBodyPart();
mimeBodyPart.setDataHandler(node.getDataHandler());
@@ -80,7 +80,7 @@
* @throws IOException
* This will write the boundary to output Stream
*/
- private static void writeMimeBoundary(OutputStream outStream,
+ protected static void writeMimeBoundary(OutputStream outStream,
String boundary) throws IOException {
outStream.write(new byte[] { 45, 45 });
outStream.write(boundary.getBytes());
@@ -90,7 +90,7 @@
* @throws IOException
* This will write the boundary with CRLF
*/
- private static void startWritingMime(OutputStream outStream, String boundary)
+ protected static void startWritingMime(OutputStream outStream, String boundary)
throws IOException {
writeMimeBoundary(outStream, boundary);
//outStream.write(CRLF);
@@ -104,7 +104,7 @@
* @throws IOException
* @throws MessagingException
*/
- private static void writeBodyPart(OutputStream outStream,
+ protected static void writeBodyPart(OutputStream outStream,
MimeBodyPart part, String boundary) throws IOException,
MessagingException {
outStream.write(CRLF);
@@ -117,7 +117,7 @@
* @throws IOException
* This will write "--" to the end of last boundary
*/
- private static void finishWritingMime(OutputStream outStream)
+ protected static void finishWritingMime(OutputStream outStream)
throws IOException {
outStream.write(new byte[] { 45, 45 });
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMOutput.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMOutput.java?rev=202519&r1=202518&r2=202519&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMOutput.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMOutput.java Thu Jun 30 03:53:39 2005
@@ -24,7 +24,6 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-
/**
* @author <a href="mailto:thilina@opensource.lk">Thilina Gunarathne </a> For
* the moment this assumes that transport takes the decision of whether
@@ -133,4 +132,4 @@
return mimeBoundary;
}*/
-}
\ No newline at end of file
+}