Author: veithen
Date: Sun Oct 16 12:14:49 2011
New Revision: 1184808

URL: http://svn.apache.org/viewvc?rev=1184808&view=rev
Log:
AXIS2-4902: Removed remaining references to Axiom LLOM implementation classes 
in jaxws.

Modified:
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java?rev=1184808&r1=1184807&r2=1184808&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBAttachmentMarshaller.java
 Sun Oct 16 12:14:49 2011
@@ -20,9 +20,8 @@
 package org.apache.axis2.datasource.jaxb;
 
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.axiom.om.impl.llom.OMTextImpl;
+import org.apache.axiom.util.UIDGenerator;
 import org.apache.axis2.Constants;
 import org.apache.axis2.Constants.Configuration;
 import org.apache.axis2.context.MessageContext;
@@ -191,7 +190,6 @@ public class JAXBAttachmentMarshaller ex
      */
     private String addDataHandler(DataHandler dh, boolean isSWA) {
         String cid = null;
-        OMText textNode = null;
         
         // If this is an MTOMXMLStreamWriter then inform the writer 
         // that it must write out this attachment (I guess we should do this
@@ -200,22 +198,19 @@ public class JAXBAttachmentMarshaller ex
             if (log.isDebugEnabled()){ 
                 log.debug("adding DataHandler for SWA");
             }
-            textNode = new OMTextImpl(dh, null);
             // If old SWA attachments, get the ID and add the attachment to 
message
-            cid = textNode.getContentID();
+            cid = UIDGenerator.generateContentId();
             addDataHandler(dh, cid);   
         } else {
             if (log.isDebugEnabled()){ 
                 log.debug("adding DataHandler for MTOM");
             }
             if (writer instanceof MTOMXMLStreamWriter) {
-                textNode = new OMTextImpl(dh, null);
-                if(((MTOMXMLStreamWriter) 
writer).isOptimizedThreshold(textNode)){
+                cid = ((MTOMXMLStreamWriter)writer).prepareDataHandler(dh);
+                if (cid != null) {
                     if (log.isDebugEnabled()){ 
                         log.debug("The MTOM attachment is written as an 
attachment part.");
                     }
-                    cid = textNode.getContentID();
-                    ((MTOMXMLStreamWriter) writer).writeOptimized(textNode);
                     // Remember the attachment on the message.
                     addDataHandler(dh, cid);
                 } else {

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?rev=1184808&r1=1184807&r2=1184808&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
 Sun Oct 16 12:14:49 2011
@@ -19,6 +19,7 @@
 
 package org.apache.axis2.jaxws.message.impl;
 
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
@@ -34,8 +35,6 @@ import org.apache.axiom.soap.SOAPFault;
 import org.apache.axiom.soap.SOAPFaultDetail;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory;
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.i18n.Messages;
 import org.apache.axis2.jaxws.message.Block;
@@ -707,13 +706,13 @@ class XMLSpineImpl implements XMLSpine {
     private static SOAPFactory _getFactory(Protocol protocol) {
         SOAPFactory soapFactory;
         if (protocol == Protocol.soap11) {
-            soapFactory = new SOAP11Factory();
+            soapFactory = OMAbstractFactory.getSOAP11Factory();
         } else if (protocol == Protocol.soap12) {
-            soapFactory = new SOAP12Factory();
+            soapFactory = OMAbstractFactory.getSOAP12Factory();
         } else if (protocol == Protocol.rest) {
             // For REST, create a SOAP 1.1 Envelope to contain the message
             // This is consistent with Axis2.
-            soapFactory = new SOAP11Factory();
+            soapFactory = OMAbstractFactory.getSOAP11Factory();
         } else {
             throw ExceptionFactory
                     
.makeWebServiceException(Messages.getMessage("RESTIsNotSupported"), null);


Reply via email to