cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r619152 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/phase/ rt/core/src/main/java/org/apache/cxf/service/factory/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ rt/transports/jms/src/main/java/org/apache/cxf...
Date Wed, 06 Feb 2008 21:00:11 GMT
Author: dkulp
Date: Wed Feb  6 13:00:08 2008
New Revision: 619152

URL: http://svn.apache.org/viewvc?rev=619152&view=rev
Log:
[CXF-1419, CXF-1418] Patch from Balaji applied (with fixes to pass tests)
Added flags to AbstractPhaseInterceptor to create unique id
Delay creation of databinding till needed so we don't create one if it's just going to be
discard.  (example: databinding configured in spring)

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt
    incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers-fromjava.wsdl
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/AbstractPhaseInterceptor.java
Wed Feb  6 13:00:08 2008
@@ -34,14 +34,25 @@
     private final Set<String> after = new SortedArraySet<String>();
 
     public AbstractPhaseInterceptor(String phase) {
-        this(null, phase);
+        this(null, phase, false);
     }
     public AbstractPhaseInterceptor(String i, String p) {
-        super();
-        id = i == null ? getClass().getName() : i;
+        this(i, p, false);
+    }
+    public AbstractPhaseInterceptor(String phase, boolean uniqueId) {
+        this(null, phase, uniqueId);
+    }
+    public AbstractPhaseInterceptor(String i, String p, boolean uniqueId) {
+        if (i == null) {
+            i = getClass().getName();
+        }
+        if (uniqueId) {
+            i += System.identityHashCode(this);
+        }
+        id = i;
         phase = p;
     }
-
+    
     public void setBefore(Collection<String> i) {
         before.clear();
         before.addAll(i);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
Wed Feb  6 13:00:08 2008
@@ -52,7 +52,13 @@
     }
 
     public DataBinding getDataBinding() {
+        if (dataBinding == null) {
+            dataBinding = createDefaultDataBinding();
+        }
         return dataBinding;
+    }
+    protected DataBinding createDefaultDataBinding() {
+        return null;
     }
 
     public void setDataBinding(DataBinding dataBinding) {

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Feb  6 13:00:08 2008
@@ -54,6 +54,7 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.common.xmlschema.XmlSchemaTools;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.databinding.source.mime.MimeAttribute;
 import org.apache.cxf.databinding.source.mime.MimeSerializer;
 import org.apache.cxf.endpoint.Endpoint;
@@ -156,8 +157,6 @@
     public ReflectionServiceFactoryBean() {
         getServiceConfigurations().add(0, new DefaultServiceConfiguration());
 
-        setDataBinding(new JAXBDataBinding(getQualifyWrapperSchema()));
-
         ignoredClasses.add("java.lang.Object");
         ignoredClasses.add("java.lang.Throwable");
         ignoredClasses.add("org.omg.CORBA_2_3.portable.ObjectImpl");
@@ -166,11 +165,14 @@
         ignoredClasses.add("javax.rmi.CORBA.Stub");
     }
 
+    
+     
+    protected DataBinding createDefaultDataBinding() {
+        return new JAXBDataBinding(getQualifyWrapperSchema());
+    }
+    
     @Override
     public Service create() {
-        // System.setProperty(Constants.SystemConstants.EXTENSION_REGISTRY_KEY,
-        // CustomExtensionRegistry.class.getName());
-
         initializeServiceConfigurations();
 
         initializeServiceModel();

Modified: incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Wed Feb  6 13:00:08 2008
@@ -374,6 +374,12 @@
             // setup the message to be send back
             message.put(JMSConstants.JMS_REQUEST_MESSAGE, 
                         inMessage.get(JMSConstants.JMS_REQUEST_MESSAGE));
+            
+            if (!message.containsKey(JMSConstants.JMS_SERVER_RESPONSE_HEADERS)
+                && inMessage.containsKey(JMSConstants.JMS_SERVER_RESPONSE_HEADERS))
{
+                message.put(JMSConstants.JMS_SERVER_RESPONSE_HEADERS,
+                            inMessage.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS));
+            }
             message.setContent(OutputStream.class,
                                new JMSOutputStream(inMessage, message));
         }
@@ -402,7 +408,7 @@
         private void commitOutputMessage() throws IOException {
             
             JMSMessageHeadersType headers =
-                (JMSMessageHeadersType) inMessage.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
+                (JMSMessageHeadersType) outMessage.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
             javax.jms.Message request = 
                 (javax.jms.Message) inMessage.get(JMSConstants.JMS_REQUEST_MESSAGE);    
         
             
@@ -444,7 +450,6 @@
                                          msgType);
 
                     setReplyCorrelationID(request, reply);
-                    
                     base.setMessageProperties(headers, reply);
                     Map<String, List<String>> protHeaders = 
                         CastUtils.cast((Map<?, ?>)outMessage.get(Message.PROTOCOL_HEADERS));

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
Wed Feb  6 13:00:08 2008
@@ -114,7 +114,7 @@
         InputStream expected = getClass()
             .getResourceAsStream("resources/expected_get_book123_xmlwrapped.txt");
 
-        String expectedString = getStringFromInputStream(expected);
+        String expectedString = getStringFromInputStream(expected).trim();
         //System.out.println("---" + getStringFromInputStream(in));
         assertEquals(expectedString, expectedString, getStringFromInputStream(in)); 
     }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt
Wed Feb  6 13:00:08 2008
@@ -1 +1 @@
-<ns1:getBookResponse xmlns:ns1="http://book.customer.cxf.apache.org/"><ns2:Book
xmlns:ns2="http://book.customer.cxf.apache.org/" xmlns="http://book.acme.com"><id>123</id><name>CXF
in Action</name></ns2:Book></ns1:getBookResponse>
\ No newline at end of file
+<ns1:getBookResponse xmlns:ns1="http://book.customer.cxf.apache.org/"><Book xmlns:ns2="http://book.acme.com"><ns2:id>123</ns2:id><ns2:name>CXF
in Action</ns2:name></Book></ns1:getBookResponse>
\ No newline at end of file

Modified: incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers-fromjava.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers-fromjava.wsdl?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers-fromjava.wsdl (original)
+++ incubator/cxf/trunk/systests/src/test/resources/wsdl/add_numbers-fromjava.wsdl Wed Feb
 6 13:00:08 2008
@@ -24,7 +24,7 @@
 		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
     <wsdl:types>
 	<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://server.addr_fromjava.ws.systest.cxf.apache.org/"

-		    attributeFormDefault="unqualified" elementFormDefault="qualified" 
+		    attributeFormDefault="unqualified" elementFormDefault="unqualified" 
 		    targetNamespace="http://server.addr_fromjava.ws.systest.cxf.apache.org/">
 	    <xsd:element name="AddNumbersException" type="tns:AddNumbersException"/>
 	    <xsd:complexType name="AddNumbersException">

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java?rev=619152&r1=619151&r2=619152&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
(original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSIBPValidator.java
Wed Feb  6 13:00:08 2008
@@ -246,6 +246,13 @@
                     continue;
                 }
                 BindingOperation bop = wsdlHelper.getBindingOperation(def, operation.getName());
+                if (bop == null) {
+                    addErrorMessage(getErrorPrefix("WSI-BP-1.0 R2718")
+                                    + "A wsdl:binding in a DESCRIPTION MUST have the same
set of "
+                                    + "wsdl:operations as the wsdl:portType to which it refers.
"
+                                    + operation.getName() + " not found in wsdl:binding.");
+                    return false;
+                }
                 Binding binding = wsdlHelper.getBinding(bop, def);
                 String bindingStyle = binding != null ? SOAPBindingUtil.getBindingStyle(binding)
: "";
                 String style = StringUtils.isEmpty(SOAPBindingUtil.getSOAPOperationStyle(bop))
@@ -258,7 +265,6 @@
                         return false;
                     }
                 } else {
-                    System.out.println("Style: " + style);
                     if (!checkR2717AndR2726(bop)) {
                         return false;
                     }



Mime
View raw message