cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r897057 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/phase/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/ systests/ws-specs/ systests/ws-sp...
Date Thu, 07 Jan 2010 23:43:08 GMT
Author: dkulp
Date: Thu Jan  7 23:43:06 2010
New Revision: 897057

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

........
  r897052 | dkulp | 2010-01-07 18:31:16 -0500 (Thu, 07 Jan 2010) | 2 lines
  
  [CXF-2591] Fix problem of handleFault not being called on interceptors
  for transport exceptions with Async calls.
........

Added:
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers-binding.xml
      - copied unchanged from r897052, cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers-binding.xml
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    cxf/branches/2.2.x-fixes/systests/ws-specs/pom.xml
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/AddNumberImpl.java
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/AddNumberImpl.java
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/AddNumberImpl.java
    cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/WSAPureWsdlTest.java

Propchange: cxf/branches/2.2.x-fixes/
            ('svn:mergeinfo' removed)

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

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
(original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Thu Jan  7 23:43:06 2010
@@ -390,7 +390,7 @@
     }
     
     @SuppressWarnings("unchecked")
-    private void unwind(Message message) {
+    public void unwind(Message message) {
         while (iterator.hasPrevious()) {
             Interceptor currentInterceptor = iterator.previous();
             if (isFineLogging) {

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Thu Jan  7 23:43:06 2010
@@ -64,6 +64,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.message.MessageUtils;
+import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractConduit;
 import org.apache.cxf.transport.Destination;
@@ -2090,10 +2091,9 @@
                         try {
                             handleResponseInternal();
                         } catch (Exception e) {
-                            Message inMessage = new MessageImpl();
-                            inMessage.setExchange(outMessage.getExchange());
-                            inMessage.setContent(Exception.class, e);
-                            incomingObserver.onMessage(inMessage);
+                            ((PhaseInterceptorChain)outMessage.getInterceptorChain()).unwind(outMessage);
+                            outMessage.setContent(Exception.class, e);
+                            outMessage.getInterceptorChain().getFaultObserver().onMessage(outMessage);
                         }
                     }
                 };

Modified: cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
Thu Jan  7 23:43:06 2010
@@ -94,6 +94,10 @@
         transformer = new VersionTransformer(this);
     } 
 
+    public Map<String, Exchange> getUncorrelatedExchanges() {
+        return uncorrelatedExchanges;
+    }
+    
     /**
      * @return the set of SOAP headers understood by this handler 
      */

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/pom.xml?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/pom.xml Thu Jan  7 23:43:06 2010
@@ -33,24 +33,6 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>add-test-source</id>
-                        <phase>generate-test-sources</phase>
-                        <goals>
-                            <goal>add-test-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>${basedir}/src/test/generated</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.cxf</groupId>
                 <artifactId>cxf-codegen-plugin</artifactId>
                 <version>${project.version}</version>
@@ -61,69 +43,16 @@
                         <configuration>
                             <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
                             <testWsdlRoot>${basedir}/src/test/resources/wsdl_systest_wsspec</testWsdlRoot>
-                        </configuration>
-                        <goals>
-                            <goal>wsdl2java</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.cxf</groupId>
-                <artifactId>cxf-codegen-plugin</artifactId>
-                <version>${project.version}</version>
-                <executions>
-                    <execution>
-                        <id>generate-addr-jaxwsmm-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
                             <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/wsdl_systest_wsspec/addr-jaxwsmm.wsdl</wsdl>
                                 </wsdlOption>
-                            </wsdlOptions>
-                        </configuration>
-                        <goals>
-                            <goal>wsdl2java</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>generate-wssec10-test-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
-                            <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/wsdl_systest_wsspec/wssec10/WsSecurity10.wsdl</wsdl>
                                 </wsdlOption>
-                            </wsdlOptions>
-                        </configuration>
-                        <goals>
-                            <goal>wsdl2java</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>generate-wssec11-test-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
-                            <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/wsdl_systest_wsspec/wssec11/WsSecurity11.wsdl</wsdl>
                                 </wsdlOption>
-                            </wsdlOptions>
-                        </configuration>
-                        <goals>
-                            <goal>wsdl2java</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>generate-wssc-test-sources</id>
-                        <phase>generate-test-sources</phase>
-                        <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
-                            <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>${basedir}/src/test/resources/wsdl_systest_wsspec/wssc/WSSecureConversation.wsdl</wsdl>
                                 </wsdlOption>

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/AddNumberImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/AddNumberImpl.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/AddNumberImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/AddNumberImpl.java
Thu Jan  7 23:43:06 2010
@@ -19,12 +19,17 @@
 
 package org.apache.cxf.systest.ws.addr_disable;
 
+import java.util.concurrent.Future;
+
 import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
 import javax.xml.ws.soap.Addressing;
 
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault_Exception;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersResponse;
 
 // Jax-WS 2.1 WS-Addressing FromWsdl
 
@@ -55,4 +60,31 @@
 
         return number1 + number2;
     }
+
+    public Response<AddNumbersResponse> addNumbers2Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers2Async(int number1, int number2,
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbers3Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers3Async(int number1, int number2,
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbersAsync(int number1, int number2) {
+        return null;
+    }
+
+    public Future<?> addNumbersAsync(int number1, int number2,
+                                     AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/AddNumberImpl.java
Thu Jan  7 23:43:06 2010
@@ -19,7 +19,11 @@
 
 package org.apache.cxf.systest.ws.addr_feature;
 
+import java.util.concurrent.Future;
+
 import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
 import javax.xml.ws.soap.Addressing;
 
 // Jax-WS 2.1 WS-Addressing FromJava
@@ -51,4 +55,31 @@
 
         return number1 + number2;
     }
+
+    public Response<AddNumbersResponse> addNumbers2Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers2Async(int number1, int number2, 
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbers3Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers3Async(int number1, int number2, 
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbersAsync(int number1, int number2) {
+        return null;
+    }
+
+    public Future<?> addNumbersAsync(int number1, int number2, 
+                                     AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/AddNumberImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/AddNumberImpl.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/AddNumberImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/AddNumberImpl.java
Thu Jan  7 23:43:06 2010
@@ -19,11 +19,16 @@
 
 package org.apache.cxf.systest.ws.addr_fromwsdl;
 
+import java.util.concurrent.Future;
+
 import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
 
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault_Exception;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersResponse;
 
 // Jax-WS 2.1 WS-Addressing FromWsdl
 
@@ -53,4 +58,31 @@
 
         return number1 + number2;
     }
+
+    public Response<AddNumbersResponse> addNumbers2Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers2Async(int number1, int number2, 
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbers3Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers3Async(int number1, int number2, 
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbersAsync(int number1, int number2) {
+        return null;
+    }
+
+    public Future<?> addNumbersAsync(int number1, int number2,
+                                     AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/AddNumberImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/AddNumberImpl.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/AddNumberImpl.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/AddNumberImpl.java
Thu Jan  7 23:43:06 2010
@@ -19,11 +19,16 @@
 
 package org.apache.cxf.systest.ws.addr_wsdl;
 
+import java.util.concurrent.Future;
+
 import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
 
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersFault_Exception;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersResponse;
 
 
 @WebService(serviceName = "AddNumbersService",
@@ -52,4 +57,31 @@
 
         return number1 + number2;
     }
+
+    public Response<AddNumbersResponse> addNumbers2Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers2Async(int number1, int number2,  
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbers3Async(int number1, int number2)
{
+        return null;
+    }
+
+    public Future<?> addNumbers3Async(int number1, int number2, 
+                                      AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
+
+    public Response<AddNumbersResponse> addNumbersAsync(int number1, int number2) {
+        return null;
+    }
+
+    public Future<?> addNumbersAsync(int number1, int number2, 
+                                     AsyncHandler<AddNumbersResponse> asyncHandler)
{
+        return null;
+    }
 }

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/WSAPureWsdlTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/WSAPureWsdlTest.java?rev=897057&r1=897056&r2=897057&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/WSAPureWsdlTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/WSAPureWsdlTest.java
Thu Jan  7 23:43:06 2010
@@ -20,19 +20,30 @@
 package org.apache.cxf.systest.ws.addr_wsdl;
 
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.StringReader;
 import java.net.URL;
+import java.util.concurrent.ExecutionException;
+
 import javax.xml.namespace.QName;
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
 import javax.xml.ws.Service.Mode;
 import javax.xml.ws.handler.MessageContext;
 
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.systest.ws.AbstractWSATestBase;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
+import org.apache.cxf.systest.ws.addr_feature.AddNumbersResponse;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersService;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -56,7 +67,8 @@
     public void testBasicInvocation() throws Exception {
         ByteArrayOutputStream input = setupInLogging();
         ByteArrayOutputStream output = setupOutLogging();
-
+        
+        Response<AddNumbersResponse> resp;
         AddNumbersPortType port = getPort();
 
         ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,

@@ -70,6 +82,25 @@
 
         assertTrue(output.toString().indexOf(expectedOut) != -1);
         assertTrue(input.toString().indexOf(expectedIn) != -1);
+        
+        
+        resp = port.addNumbers3Async(1, 2);
+        assertEquals(3, resp.get().getReturn());
+
+        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                                        "http://localhost:9094/doesntexist");
+        resp = port.addNumbers3Async(1, 2);
+        try {
+            resp.get();
+        } catch (ExecutionException ex) {
+            assertTrue(ex.getCause() instanceof IOException);
+            Client c = ClientProxy.getClient(port);
+            for (Interceptor<? extends Message> m : c.getOutInterceptors()) {
+                if (m instanceof MAPCodec) {
+                    assertTrue(((MAPCodec)m).getUncorrelatedExchanges().isEmpty());
+                }
+            }
+        }
     }
     @Test
     public void testProviderEndpoint() throws Exception {



Mime
View raw message