Author: dkulp
Date: Mon Jan 23 20:00:51 2012
New Revision: 1234959
URL: http://svn.apache.org/viewvc?rev=1234959&view=rev
Log:
Merged revisions 1234954 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1234954 | dkulp | 2012-01-23 14:55:38 -0500 (Mon, 23 Jan 2012) | 2 lines
[CXF-4056, CXF-4057] Fix a couple of issues with echoed WS-Addressing
headers and faults causing clients to hang until a timeout.
........
Added:
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImplNoAddr.java
- copied unchanged from r1234954,
cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImplNoAddr.java
Modified:
cxf/branches/2.5.x-fixes/ (props changed)
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
Propchange: cxf/branches/2.5.x-fixes/
('svn:mergeinfo' removed)
Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=1234959&r1=1234958&r2=1234959&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Mon Jan 23 20:00:51 2012
@@ -394,7 +394,7 @@ public class SoapBindingFactory extends
sb.getOutInterceptors().add(new AttachmentOutInterceptor());
sb.getOutInterceptors().add(new StaxOutInterceptor());
- sb.getOutInterceptors().add(new SoapHeaderOutFilterInterceptor());
+ sb.getOutInterceptors().add(SoapHeaderOutFilterInterceptor.INSTANCE);
if
(SoapBindingConstants.BINDING_STYLE_RPC.equalsIgnoreCase(bindingStyle)) {
sb.getInInterceptors().add(new RPCInInterceptor());
@@ -422,6 +422,7 @@ public class SoapBindingFactory extends
sb.getOutInterceptors().add(new SoapPreProtocolOutInterceptor());
sb.getOutInterceptors().add(new SoapOutInterceptor(getBus()));
sb.getOutFaultInterceptors().add(new SoapOutInterceptor(getBus()));
+
sb.getOutFaultInterceptors().add(SoapHeaderOutFilterInterceptor.INSTANCE);
// REVISIT: The phase interceptor chain seems to freak out if this
added
// first. Not sure what the deal is at the moment, I suspect the
Modified:
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java?rev=1234959&r1=1234958&r2=1234959&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
(original)
+++
cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
Mon Jan 23 20:00:51 2012
@@ -27,6 +27,7 @@ import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.Phase;
public class SoapHeaderOutFilterInterceptor extends AbstractSoapInterceptor {
+ public static final SoapHeaderOutFilterInterceptor INSTANCE = new
SoapHeaderOutFilterInterceptor();
public SoapHeaderOutFilterInterceptor() {
super(Phase.PRE_LOGICAL);
Modified:
cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1234959&r1=1234958&r2=1234959&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
(original)
+++
cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
Mon Jan 23 20:00:51 2012
@@ -825,7 +825,8 @@ public class ClientImpl
} finally {
BusFactory.setThreadDefaultBus(origBus);
synchronized (message.getExchange()) {
- if (!isPartialResponse(message)) {
+ if (!isPartialResponse(message)
+ || message.getContent(Exception.class) != null) {
message.getExchange().put(FINISHED, Boolean.TRUE);
message.getExchange().setInMessage(message);
message.getExchange().notifyAll();
Modified:
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java?rev=1234959&r1=1234958&r2=1234959&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java
(original)
+++
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java
Mon Jan 23 20:00:51 2012
@@ -25,6 +25,7 @@ import java.util.Map;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.soap.SOAPFaultException;
+import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.systest.ws.AbstractWSATestBase;
import org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl;
import org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImplService;
@@ -44,7 +45,7 @@ public class WSAFromJavaTest extends Abs
@BeforeClass
public static void startServers() throws Exception {
- assertTrue("server did not launch correctly",
launchServer(Server.class));
+ assertTrue("server did not launch correctly",
launchServer(Server.class, true));
}
@Test
@@ -172,4 +173,23 @@ public class WSAFromJavaTest extends Abs
assertTrue(e.getMessage().contains("Unexpected wrapper"));
}
}
+
+ @Test
+ public void testFaultFromNonAddressService() throws Exception {
+ new LoggingFeature().initialize(this.getBus());
+ AddNumberImpl port = getPort();
+ java.util.Map<String, Object> requestContext =
((BindingProvider)port).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ "http://localhost:" + PORT +
"/AddNumberImplPort-noaddr");
+
+ long start = System.currentTimeMillis();
+ port.addNumbers(1, 2);
+ try {
+ port.addNumbers3(-1, -1);
+ } catch (Exception ex) {
+ //ignore, expected
+ }
+ long end = System.currentTimeMillis();
+ assertTrue((end - start) < 50000);
+ }
}
\ No newline at end of file
Modified:
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java?rev=1234959&r1=1234958&r2=1234959&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
(original)
+++
cxf/branches/2.5.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
Mon Jan 23 20:00:51 2012
@@ -29,11 +29,13 @@ public class Server extends AbstractBusT
protected void run() {
Object implementor = new AddNumberImpl();
String address = "http://localhost:" + PORT + "/AddNumberImplPort";
-
EndpointImpl ep = new EndpointImpl(implementor);
-
ep.getFeatures().add(new WSAddressingFeature());
ep.publish(address);
+
+ ep = new EndpointImpl(new AddNumberImplNoAddr());
+ ep.publish(address + "-noaddr");
+
}
public static void main(String[] args) {