cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r881078 - in /cxf/branches/2.1.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/ systests/jaxws/src/test/java/org/apache/cxf/systest/provider/
Date Tue, 17 Nov 2009 01:16:33 GMT
Author: dkulp
Date: Tue Nov 17 01:16:33 2009
New Revision: 881078

URL: http://svn.apache.org/viewvc?rev=881078&view=rev
Log:
Merged revisions 880999 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r880999 | dkulp | 2009-11-16 17:11:15 -0500 (Mon, 16 Nov 2009) | 10 lines
  
  Merged revisions 880986 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r880986 | dkulp | 2009-11-16 17:01:46 -0500 (Mon, 16 Nov 2009) | 2 lines
    
    [CXF-2543] On the client side, check the response qname to make sure it
    is what was expected
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
    cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java

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

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=881078&r1=881077&r2=881078&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
Tue Nov 17 01:16:33 2009
@@ -99,6 +99,11 @@
     
                 // Determine if there is a wrapper class
                 if (msgInfo.getMessageParts().get(0).getTypeClass() != null) {
+                    QName startQName = xmlReader.getName();
+                    if (client && !msgInfo.getMessageParts().get(0).getConcreteName().equals(startQName))
{
+                        throw new Fault("UNEXPECTED_WRAPPER_ELEMENT", LOG, null, startQName,
+                                        msgInfo.getMessageParts().get(0).getConcreteName());
+                    }
                     Object wrappedObject = dr.read(msgInfo.getMessageParts().get(0), xmlReader);
                     parameters.put(msgInfo.getMessageParts().get(0), wrappedObject);
                 } else {

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties?rev=881078&r1=881077&r2=881078&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
Tue Nov 17 01:16:33 2009
@@ -39,4 +39,5 @@
 COULD_NOT_FIND_SEICLASS=Could not find the class: {0}
 EXCEPTION_WHILE_WRITING_FAULT = Exception occurred while writing fault.
 EXCEPTION_WHILE_CREATING_EXCEPTION = Exception occurred while creating exception: {0}
+UNEXPECTED_WRAPPER_ELEMENT = Unexpected wrapper element {0} found.   Expected {1}.
  

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java?rev=881078&r1=881077&r2=881078&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
Tue Nov 17 01:16:33 2009
@@ -30,8 +30,11 @@
 import javax.xml.ws.ServiceMode;
 import javax.xml.ws.WebServiceProvider;
 
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+import org.apache.cxf.helpers.DOMUtils;
+
 //The following wsdl file is used.
 //wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl"
 @WebServiceProvider(portName = "SoapProviderPort", serviceName = "SOAPProviderService",
@@ -72,7 +75,13 @@
             if (n.getLocalName().equals(sayHi.getLocalPart())) {
                 response = sayHiResponse;
             } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
-                response = greetMeResponse;
+                Element el = DOMUtils.getFirstElement(n);
+                String v = DOMUtils.getContent(el);
+                if (v.contains("Return sayHi")) {
+                    response = sayHiResponse;
+                } else {
+                    response = greetMeResponse;
+                }
             }
         } catch (Exception ex) {
             ex.printStackTrace();

Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java?rev=881078&r1=881077&r2=881078&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ProviderClientServerTest.java
Tue Nov 17 01:16:33 2009
@@ -77,6 +77,13 @@
         String response2 = new String("Bonjour");
         try {
             Greeter greeter = service.getPort(portName, Greeter.class);
+            try {
+                greeter.greetMe("Return sayHi");
+                fail("Should have thrown an exception");
+            } catch (Exception ex) {
+                //expected 
+                assertTrue(ex.getMessage().contains("sayHiResponse"));
+            }
             for (int idx = 0; idx < 2; idx++) {
                 String greeting = greeter.greetMe("Milestone-" + idx);
                 assertNotNull("no response received from service", greeting);
@@ -89,6 +96,7 @@
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();
         }
+        
     }
 
 }



Mime
View raw message