cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r606109 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ bindings/soap/src/test/java/org/apache/cxf/binding/soap/ core/src/main/java/org/apache/cxf/attachment/ core/src/main/java/org/apache/...
Date Fri, 21 Dec 2007 06:04:13 GMT
Author: mmao
Date: Thu Dec 20 22:04:12 2007
New Revision: 606109

URL: http://svn.apache.org/viewvc?rev=606109&view=rev
Log:
CXF-1324
 * Configure the SOAPAction URI through the JAXWS context
 * LoggingOut log the protocol headers and contentType
 * Using the SOAPAction Constants instead of hard code string 


Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java
    incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInInterceptor.java
Thu Dec 20 22:04:12 2007
@@ -25,6 +25,7 @@
 
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.endpoint.Endpoint;
@@ -48,7 +49,7 @@
         if (message.getVersion() instanceof Soap11) {
             Map<String, List<String>> headers = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
             if (headers != null) {
-                List<String> sa = headers.get("SOAPAction");
+                List<String> sa = headers.get(SoapBindingConstants.SOAP_ACTION);
                 if (sa != null && sa.size() > 0) {
                     String action = sa.get(0);
                     if (action.startsWith("\"")) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionOutInterceptor.java
Thu Dec 20 22:04:12 2007
@@ -67,8 +67,8 @@
                 message.put(Message.PROTOCOL_HEADERS, reqHeaders);
             }
             
-            if (!reqHeaders.containsKey("SOAPAction")) {            
-                reqHeaders.put("SOAPAction", Collections.singletonList(action));
+            if (!reqHeaders.containsKey(SoapBindingConstants.SOAP_ACTION)) {            
+                reqHeaders.put(SoapBindingConstants.SOAP_ACTION, Collections.singletonList(action));
             }
         } else if (message.getVersion() instanceof Soap12 && !"\"\"".equals(action))
{
             String ct = (String) message.get(Message.CONTENT_TYPE);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
Thu Dec 20 22:04:12 2007
@@ -56,7 +56,7 @@
         (new SoapActionOutInterceptor()).handleMessage(soapMessage);
         Map<String, List<String>> reqHeaders = CastUtils.cast((Map)soapMessage.get(Message.PROTOCOL_HEADERS));
         assertNotNull(reqHeaders);
-        assertEquals("\"\"", reqHeaders.get("SOAPAction").get(0));
+        assertEquals("\"\"", reqHeaders.get(SoapBindingConstants.SOAP_ACTION).get(0));
 
         sb.setSoapVersion(Soap12.getInstance());
         soapMessage.clear();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
Thu Dec 20 22:04:12 2007
@@ -285,6 +285,7 @@
 
         final String ct = headers.getHeader("Content-Type", null);
         DataSource source = new AttachmentDataSource(ct, new DelegatingInputStream(partStream));
+        //DataSource source = new AttachmentDataSource(null, new DelegatingInputStream(partStream));
         att.setDataHandler(new DataHandler(source));
 
         for (Enumeration<?> e = headers.getAllHeaders(); e.hasMoreElements();) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
Thu Dec 20 22:04:12 2007
@@ -59,7 +59,9 @@
         buffer.append(encoding);
         buffer.append("\nHeaders: ");
         buffer.append(header);
+        buffer.append("\nMessages: ");
         buffer.append(message);
+        buffer.append("\nPayload: ");
         buffer.append(payload);
         buffer.append("\n--------------------------------------");
         return buffer.toString();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
Thu Dec 20 22:04:12 2007
@@ -74,11 +74,17 @@
             // Write the output while caching it for the log message
             final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(os);
             message.setContent(OutputStream.class, newOut);
-            newOut.registerCallback(new LoggingCallback());
+            newOut.registerCallback(new LoggingCallback(message));
         }
     }
 
     class LoggingCallback implements CachedOutputStreamCallback {
+        
+        private final Message message;
+        
+        public LoggingCallback(final Message msg) {
+            this.message = msg;
+        }
 
         public void onFlush(CachedOutputStream cos) {  
             
@@ -86,6 +92,18 @@
         
         public void onClose(CachedOutputStream cos) {
             final LoggingMessage buffer = new LoggingMessage("Outbound Message\n---------------------------");
+            
+            String encoding = (String)message.get(Message.ENCODING);
+
+            if (encoding != null) {
+                buffer.getEncoding().append(encoding);
+            }            
+            
+            Object headers = message.get(Message.PROTOCOL_HEADERS);
+
+            if (headers != null) {
+                buffer.getHeader().append(headers);
+            }
 
             if (cos.getTempFile() == null) {
                 //buffer.append("Outbound Message:\n");

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ContextPropertiesMapping.java
Thu Dec 20 22:04:12 2007
@@ -31,6 +31,7 @@
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.MessageContext.Scope;
 
+import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.endpoint.Endpoint;
@@ -91,6 +92,8 @@
                          "HTTP.RESPONSE");
         jaxws2cxfMap.put(MessageContext.SERVLET_CONTEXT, 
                         "HTTP.CONTEXT");
+        
+        jaxws2cxfMap.put(BindingProvider.SOAPACTION_URI_PROPERTY, SoapBindingConstants.SOAP_ACTION);
     }
     
     private ContextPropertiesMapping() {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
Thu Dec 20 22:04:12 2007
@@ -86,7 +86,7 @@
     
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei, 
                              List<WebServiceFeature> wf) throws EndpointException {
-        this(bus, s, ei, null, wf, null, true);
+        this(bus, s, ei, null, wf, new ArrayList<AbstractFeature>(), true);
     }    
 
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei, JaxWsImplementorInfo implementorInfo,


Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java Thu
Dec 20 22:04:12 2007
@@ -25,6 +25,8 @@
 import java.util.Set;
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.binding.soap.SoapBindingConstants;
+
 
 /**
  * Holder for WS-Addressing names (of headers, namespaces etc.).
@@ -146,7 +148,7 @@
     public static final String SOAP12HTTP_ADDRESSING_BINDING = 
         "http://www.w3.org/2003/05/soap-envelope?addressing=ms";
     
-    public static final String SOAP_ACTION_HEADER = "SOAPAction";
+    public static final String SOAP_ACTION_HEADER = SoapBindingConstants.SOAP_ACTION;
     
     /**
      * The set of headers understood by the protocol binding.

Modified: incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java?rev=606109&r1=606108&r2=606109&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Thu Dec 20 22:04:12 2007
@@ -36,6 +36,7 @@
 import org.w3c.dom.NodeList;
 
 
+import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
@@ -337,7 +338,7 @@
         if (preExistingSOAPAction) {
             List<String> soapAction = new ArrayList<String>();
             soapAction.add("\"foobar\"");
-            mimeHeaders.put("SOAPAction", soapAction);
+            mimeHeaders.put(SoapBindingConstants.SOAP_ACTION, soapAction);
         }
         if (invalidMAP) {
             message.put("org.apache.cxf.ws.addressing.map.fault.name",



Mime
View raw message