cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r658443 - in /cxf/branches/2.0.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/
Date Tue, 20 May 2008 21:21:56 GMT
Author: dkulp
Date: Tue May 20 14:21:56 2008
New Revision: 658443

URL: http://svn.apache.org/viewvc?rev=658443&view=rev
Log:
Merged revisions 658433 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r658433 | dkulp | 2008-05-20 17:08:04 -0400 (Tue, 20 May 2008) | 2 lines
  
  [CXF-1575, CXF-1592] Don't map webServiceException into the wsdl.  In some cases, allow
an older saaj implementation.
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?rev=658443&r1=658442&r2=658443&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
Tue May 20 14:21:56 2008
@@ -30,6 +30,7 @@
 import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPFault;
 import javax.xml.ws.AsyncHandler;
 import javax.xml.ws.Binding;
@@ -183,31 +184,11 @@
                 exception.initCause(ex);
                 throw exception;
             } else if (getBinding() instanceof SOAPBinding) {
-                SOAPFault soapFault = ((SOAPBinding)getBinding()).getSOAPFactory().createFault();
+                SOAPFault soapFault = createSoapFault(ex);
+                if (soapFault == null) {
+                    throw new WebServiceException(ex);
+                }
                 
-                if (ex instanceof SoapFault) {
-                    soapFault.setFaultString(((SoapFault)ex).getReason());
-                    soapFault.setFaultCode(((SoapFault)ex).getFaultCode());
-                    soapFault.setFaultActor(((SoapFault)ex).getRole());
-
-                    Node nd = soapFault.getOwnerDocument().importNode(((SoapFault)ex).getOrCreateDetail(),
-                                                                      true);
-                    nd = nd.getFirstChild();
-                    soapFault.addDetail();
-                    while (nd != null) {
-                        Node next = nd.getNextSibling();
-                        soapFault.getDetail().appendChild(nd);
-                        nd = next;
-                    }
- 
-                } else {
-                    soapFault.setFaultCode(new QName("http://cxf.apache.org/faultcode", "HandlerFault"));
-                    String msg = ex.getMessage();
-                    if (msg != null) {
-                        soapFault.setFaultString(msg);
-                    }
-                }      
-  
                 SOAPFaultException  exception = new SOAPFaultException(soapFault);
                 exception.initCause(ex);
                 throw exception;                
@@ -234,6 +215,47 @@
 
     }
     
+    private SOAPFault createSoapFault(Exception ex) throws SOAPException {
+        SOAPFault soapFault;
+        try {
+            soapFault = ((SOAPBinding)getBinding()).getSOAPFactory().createFault();
+        } catch (Throwable t) {
+            //probably an old version of saaj or something that is not allowing createFault

+            //method to work.  Try the saaj 1.2 method of doing this.
+            try {
+                soapFault = ((SOAPBinding)getBinding()).getMessageFactory().createMessage()
+                    .getSOAPBody().addFault();
+            } catch (Throwable t2) {
+                //still didn't work, we'll just throw what we have
+                return null;
+            }                        
+        }
+        
+        if (ex instanceof SoapFault) {
+            soapFault.setFaultString(((SoapFault)ex).getReason());
+            soapFault.setFaultCode(((SoapFault)ex).getFaultCode());
+            soapFault.setFaultActor(((SoapFault)ex).getRole());
+
+            Node nd = soapFault.getOwnerDocument().importNode(((SoapFault)ex).getOrCreateDetail(),
+                                                              true);
+            nd = nd.getFirstChild();
+            soapFault.addDetail();
+            while (nd != null) {
+                Node next = nd.getNextSibling();
+                soapFault.getDetail().appendChild(nd);
+                nd = next;
+            }
+
+        } else {
+            soapFault.setFaultCode(new QName("http://cxf.apache.org/faultcode", "HandlerFault"));
+            String msg = ex.getMessage();
+            if (msg != null) {
+                soapFault.setFaultString(msg);
+            }
+        }      
+        return soapFault;
+    }
+
     private boolean addressChanged(String address) {
         return !(address == null
                  || getClient().getEndpoint().getEndpointInfo() == null

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=658443&r1=658442&r2=658443&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Tue May 20 14:21:56 2008
@@ -290,7 +290,8 @@
     protected Class<?> getBeanClass(Class<?> exClass) {
         try {
             if (java.rmi.ServerException.class.isAssignableFrom(exClass)
-                || java.rmi.RemoteException.class.isAssignableFrom(exClass)) {
+                || java.rmi.RemoteException.class.isAssignableFrom(exClass)
+                || "javax.xml.ws".equals(exClass.getPackage().getName())) {
                 return null;
             }
 

Modified: cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=658443&r1=658442&r2=658443&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue May 20 14:21:56 2008
@@ -642,6 +642,9 @@
         for (int i = 0; i < types.length; i++) {
             Class exClass = types[i];
             Class beanClass = getBeanClass(exClass);
+            if (beanClass == null) {
+                continue;
+            }
 
             QName name = getFaultName(o.getInterface(), o, exClass, beanClass);
 



Mime
View raw message