You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by th...@apache.org on 2005/07/01 08:25:45 UTC

svn commit: r208720 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/transport/http/HTTPTransportUtils.java xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java

Author: thilina
Date: Thu Jun 30 23:25:43 2005
New Revision: 208720

URL: http://svn.apache.org/viewcvs?rev=208720&view=rev
Log:
Temporary fix to the namespace serialisation prob of OMText

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java?rev=208720&r1=208719&r2=208720&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportUtils.java Thu Jun 30 23:25:43 2005
@@ -181,7 +181,14 @@
 			XMLStreamException, FactoryConfigurationError {
 		StAXBuilder builder = null;
 
-		MIMEHelper mimeHelper = new MIMEHelper(inStream, contentTypeString);
+		boolean fileCacheForAttachments = (Constants.VALUE_TRUE.equals(msgContext.getProperty(Constants.Configuration.CACHE_ATTACHMENTS)));
+		String attachmentRepoDir=null;
+		if (fileCacheForAttachments)
+		{
+			attachmentRepoDir = (String)msgContext.getProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR);
+		}
+			
+		MIMEHelper mimeHelper = new MIMEHelper(inStream, contentTypeString,fileCacheForAttachments,attachmentRepoDir);
 		XMLStreamReader reader = XMLInputFactory.newInstance()
 				.createXMLStreamReader(
 						new BufferedReader(new InputStreamReader(mimeHelper

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java?rev=208720&r1=208719&r2=208720&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java Thu Jun 30 23:25:43 2005
@@ -108,14 +108,7 @@
 	 *            of the Binary
 	 */
 	public OMTextImpl(String s, String mimeType, boolean optimize) {
-		this(s);
-		this.mimeType = mimeType;
-		this.optimize = optimize;
-		if (this.contentID == null && optimize==true) {
-			createContentID();
-		}
-        done = true;
-
+		this(null,s,mimeType,optimize);
 	}
 
 	/**
@@ -134,7 +127,6 @@
 			createContentID();
 		}
         done = true;
-
 	}
 
 	/**
@@ -142,13 +134,7 @@
 	 *            To send binary optimised content Created programatically.
 	 */
 	public OMTextImpl(DataHandler dataHandler) {
-		this.dataHandler = dataHandler;
-		this.isBinary = true;
-		this.optimize = true;
-		if (this.contentID == null) {
-			createContentID();
-		}
-        done = true;
+		this(dataHandler,true);
 
 	}
 
@@ -367,6 +353,7 @@
 				.nextLong());
 	}
 
+
 	/*
 	 * Methods to copy from OMSerialize utils
 	 */
@@ -377,28 +364,29 @@
 		String prefix = null;
 		XMLStreamWriter writer = omOutput.getXmlStreamWriter();
 		if (this.ns != null) {
-			nameSpaceName = this.ns.getName();
-			writer_prefix = writer.getPrefix(nameSpaceName);
-			prefix = this.ns.getPrefix();
-			if (nameSpaceName != null) {
-				if (writer_prefix != null) {
-					writer
-							.writeStartElement(nameSpaceName, this
-									.getLocalName());
-				} else {
-					if (prefix != null) {
-						writer.writeStartElement(prefix, this.getLocalName(),
-								nameSpaceName);
-						writer.writeNamespace(prefix, nameSpaceName);
-						writer.setPrefix(prefix, nameSpaceName);
-					} else {
-						writer.writeStartElement(nameSpaceName, this
-								.getLocalName());
-						writer.writeDefaultNamespace(nameSpaceName);
-						writer.setDefaultNamespace(nameSpaceName);
-					}
-				}
-			} else {
+            nameSpaceName = this.ns.getName();
+            writer_prefix = writer.getPrefix(nameSpaceName);
+            prefix = this.ns.getPrefix();
+          
+            if (nameSpaceName != null) {
+                if (writer_prefix != null) {
+                    writer.writeStartElement(nameSpaceName,
+                            this.getLocalName());
+                } else {
+                    if (prefix != null) {
+                        writer.writeStartElement(prefix, this.getLocalName(),
+                                nameSpaceName);
+                        //TODO FIX ME
+                        //writer.writeNamespace(prefix, nameSpaceName);
+                        writer.setPrefix(prefix, nameSpaceName);
+                    } else {
+                        writer.writeStartElement(nameSpaceName,
+                                this.getLocalName());
+                        writer.writeDefaultNamespace(nameSpaceName);
+                        writer.setDefaultNamespace(nameSpaceName);
+                    }
+                }
+            } else {
 				writer.writeStartElement(this.getLocalName());
 
 			}
@@ -408,6 +396,7 @@
 		}
 
 		// add the elements attribute "href"
+		
 		serializeAttribute(this.attribute, omOutput);
 
 		// add the namespace
@@ -459,12 +448,12 @@
 		XMLStreamWriter writer = omOutput.getXmlStreamWriter();
 		if (namespace != null) {
 			String uri = namespace.getName();
-			String prefix = writer.getPrefix(uri);
+			//String prefix = writer.getPrefix(uri);
 			String ns_prefix = namespace.getPrefix();
-			if (prefix == null) {
+			//if (prefix == null) {
 				writer.writeNamespace(ns_prefix, namespace.getName());
 				writer.setPrefix(ns_prefix, uri);
-			}
+			//}
 		}
 	}