cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r767189 - in /cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
Date Tue, 21 Apr 2009 15:33:25 GMT
Author: dkulp
Date: Tue Apr 21 15:33:24 2009
New Revision: 767189

URL: http://svn.apache.org/viewvc?rev=767189&view=rev
Log:
Use the cached factories for the MessageModeOut stuff as well

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java?rev=767189&r1=767188&r2=767189&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
Tue Apr 21 15:33:24 2009
@@ -74,7 +74,7 @@
     public SAAJOutInterceptor() {
         super(Phase.PRE_PROTOCOL);
     }
-    private synchronized MessageFactory getFactory(SoapMessage message) throws SOAPException
{
+    public synchronized MessageFactory getFactory(SoapMessage message) throws SOAPException
{
         if (message.getVersion() instanceof Soap11) {
             if (factory11 == null) { 
                 factory11 = MessageFactory.newInstance();

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?rev=767189&r1=767188&r2=767189&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Tue Apr
21 15:33:24 2009
@@ -29,7 +29,6 @@
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
 import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConstants;
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPFault;
 import javax.xml.soap.SOAPMessage;
@@ -57,7 +56,6 @@
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Node;
 
-import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
@@ -117,8 +115,9 @@
                                     m,
                                     "SOAP/HTTP");
             } else if (m == Service.Mode.MESSAGE) {
-                client.getOutInterceptors().add(new SAAJOutInterceptor());
-                client.getOutInterceptors().add(new MessageModeOutInterceptor());
+                SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
+                client.getOutInterceptors().add(saajOut);
+                client.getOutInterceptors().add(new MessageModeOutInterceptor(saajOut));
                 client.getInInterceptors().add(new SAAJInInterceptor());
                 client.getInInterceptors().add(new MessageModeInInterceptor(clazz));
             }
@@ -310,9 +309,11 @@
     
     
     static class MessageModeOutInterceptor extends AbstractSoapInterceptor {
-        public MessageModeOutInterceptor() {
+        SAAJOutInterceptor saajOut;
+        public MessageModeOutInterceptor(SAAJOutInterceptor saajOut) {
             super(Phase.PRE_PROTOCOL);
             addBefore(SAAJOutInterceptor.class.getName());
+            this.saajOut = saajOut;
         }
 
         public void handleMessage(SoapMessage message) throws Fault {
@@ -324,13 +325,7 @@
                 soapMessage = (SOAPMessage)o;
             } else {
                 try {
-                    MessageFactory factory = null;
-                    if (message.getVersion() instanceof Soap11) {
-                        factory = MessageFactory.newInstance();
-                    } else {
-                        factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
-                    }
-                    
+                    MessageFactory factory = saajOut.getFactory(message);
                     soapMessage = factory.createMessage();
                     SOAPPart part = soapMessage.getSOAPPart();
                     if (o instanceof Source) {



Mime
View raw message