cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r476038 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/interceptor/ databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ databinding/jaxb/src/test/java/org/apache/cxf/jaxb/ frontend/simple/src/main/java/org/apache/cxf/servic...
Date Fri, 17 Nov 2006 03:34:10 GMT
Author: mmao
Date: Thu Nov 16 19:34:09 2006
New Revision: 476038

URL: http://svn.apache.org/viewvc?view=rev&rev=476038
Log:
CXF-246
* Apply Patch CXF-246 contributed by Unreal Jiang
* In Code-Firt model, message processing in client side and server side are different

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java?view=diff&rev=476038&r1=476037&r2=476038
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
Thu Nov 16 19:34:09 2006
@@ -86,7 +86,7 @@
         MessageInfo msgInfo = setMessage(message, operation, requestor);
         
         // Determine if there is a wrapper class
-        if ((operation.isUnwrapped() || operation.isUnwrappedCapable())
+        if (operation.isUnwrappedCapable()
             && msgInfo.getMessageParts().get(0).getTypeClass() != null) {
             objects = new ArrayList<Object>();
             Object wrappedObject = dr.read(msgInfo.getMessageParts().get(0), message);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?view=diff&rev=476038&r1=476037&r2=476038
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Thu Nov 16 19:34:09 2006
@@ -61,14 +61,7 @@
                 xmlWriter.setDefaultNamespace(name.getNamespaceURI());
                 xmlWriter.writeStartElement(name.getNamespaceURI(), name.getLocalPart());
                 xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
-                if (!message.getInterceptorChain().doIntercept(message) 
-                        && message.getContent(Exception.class) != null) {       
            
-                    if (message.getContent(Exception.class) instanceof Fault) {
-                        throw (Fault)message.getContent(Exception.class);
-                    } else {
-                        throw new Fault(message.getContent(Exception.class));
-                    }                    
-                }
+                message.getInterceptorChain().doIntercept(message);
                 xmlWriter.writeEndElement();
             } catch (XMLStreamException e) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC",
BUNDLE), e);

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?view=diff&rev=476038&r1=476037&r2=476038
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Thu Nov 16 19:34:09 2006
@@ -25,6 +25,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -244,6 +245,17 @@
 
 
     public static JAXBContext createJAXBContext(Set<Class<?>> classes) throws
JAXBException {
+        Iterator it = classes.iterator();
+        String className = "";
+        Object remoteExceptionObject = null;
+        while (it.hasNext()) {
+            remoteExceptionObject = (Class)it.next();
+            className = remoteExceptionObject.toString();
+            if (!("".equals(className)) && className.contains("RemoteException"))
{
+                classes.remove(remoteExceptionObject);
+            }
+        }
+
         try {
             classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.AttributedQNameType"));
             classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.ObjectFactory"));

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?view=diff&rev=476038&r1=476037&r2=476038
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Thu Nov 16 19:34:09 2006
@@ -20,8 +20,10 @@
 package org.apache.cxf.jaxb;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
@@ -112,6 +114,17 @@
         assertNotNull(jmsSchema.getElement());
         assertEquals(wsdlSchema.getNamespaceURI(), "http://schemas.xmlsoap.org/wsdl/");
         assertEquals(jmsSchema.getNamespaceURI(), "http://cxf.apache.org/transports/jms");
+    }
+    
+    public void testCreateJAXBContext() throws Exception {
+        try {
+            Set<Class<?>> classes = new HashSet<Class<?>>();
+            classes.add(Class.forName("java.rmi.RemoteException"));
+            assertNotNull(JAXBDataBinding.createJAXBContext(classes));
+        } catch (Exception e) {
+            assertFalse(true);
+        }
+        
     }
 
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java?view=diff&rev=476038&r1=476037&r2=476038
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java
Thu Nov 16 19:34:09 2006
@@ -82,9 +82,7 @@
     private BindingOperationInfo getRealOperation(OperationInfo o, BindingOperationInfo bop)
{
         BindingOperationInfo unwrappedOp = bop.getUnwrappedOperation();
         if (unwrappedOp != null
-            && unwrappedOp.getOperationInfo().equals(o.getUnwrappedOperation())
-            && unwrappedOp.getWrappedOperation().getInput().getMessageInfo()
-                .getMessagePartByIndex(0).getTypeClass() != null) {
+            && unwrappedOp.getOperationInfo().equals(o.getUnwrappedOperation()))
{
             bop = unwrappedOp;
         }
         return bop;



Mime
View raw message