You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/01/21 21:00:18 UTC
svn commit: r1061989 - in /cxf/trunk:
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/
systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/
Author: dkulp
Date: Fri Jan 21 20:00:17 2011
New Revision: 1061989
URL: http://svn.apache.org/viewvc?rev=1061989&view=rev
Log:
[CXF-3170] SAAJInINterceptor doesn't filter out GET requests
Modified:
cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=1061989&r1=1061988&r2=1061989&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java (original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java Fri Jan 21 20:00:17 2011
@@ -98,6 +98,10 @@ public class SAAJInInterceptor extends A
}
public void handleMessage(SoapMessage message) throws Fault {
+ if (isGET(message)) {
+ return;
+ }
+
try {
MessageFactory factory = getFactory(message);
SOAPMessage soapMessage = factory.createMessage();
Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=1061989&r1=1061988&r2=1061989&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Fri Jan 21 20:00:17 2011
@@ -58,6 +58,7 @@ import org.apache.cxf.common.WSDLConstan
import org.apache.cxf.common.util.ASMHelper;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.helpers.XPathUtils;
import org.apache.cxf.jaxb_element_test.JaxbElementTest;
@@ -87,7 +88,14 @@ public class ClientServerMiscTest extend
public static void startServers() throws Exception {
assertTrue("server did not launch correctly", launchServer(ServerMisc.class));
}
-
+ @Test
+ public void testCXF3170() throws Exception {
+ URL url = new URL(ServerMisc.DOCLITBARE_CODEFIRST_URL + "/foo");
+ HttpURLConnection con = (HttpURLConnection)url.openConnection();
+ con.getResponseCode();
+ String str = IOUtils.readStringFromStream(con.getErrorStream());
+ assertTrue(str.contains("/foo")); //No such operation
+ }
@Test
public void testWSDLDocs() throws Exception {
Map<String, String> ns = new HashMap<String, String>();
Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java?rev=1061989&r1=1061988&r2=1061989&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java (original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java Fri Jan 21 20:00:17 2011
@@ -22,7 +22,9 @@ package org.apache.cxf.systest.jaxws;
import javax.xml.ws.Endpoint;
import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl;
+import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
import org.apache.cxf.jaxb_element_test.JaxbElementTestImpl;
+import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.jaxws.JAXWSMethodInvoker;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.ordered_param_holder.OrderedParamHolderImpl;
@@ -82,7 +84,9 @@ public class ServerMisc extends Abstract
//Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
Object implementor7 = new DocLitBareCodeFirstServiceImpl();
- Endpoint.publish(DOCLITBARE_CODEFIRST_URL, implementor7);
+ EndpointImpl ep = (EndpointImpl)Endpoint.publish(DOCLITBARE_CODEFIRST_URL, implementor7);
+ ep.getServer().getEndpoint().getInInterceptors().add(new SAAJInInterceptor());
+
Object implementor6 = new InterfaceInheritTestImpl();
Endpoint.publish(DOCLIT_CODEFIRST_BASE_URL, implementor6);
@@ -107,6 +111,7 @@ public class ServerMisc extends Abstract
Endpoint.publish("http://localhost:" + PORT + "/InheritContext/InheritPort",
new InheritImpl());
+
}
public static void main(String[] args) {