Author: dkulp Date: Tue Dec 15 03:18:28 2009 New Revision: 890624 URL: http://svn.apache.org/viewvc?rev=890624&view=rev Log: Merged revisions 890612 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................ r890612 | dkulp | 2009-12-14 21:52:10 -0500 (Mon, 14 Dec 2009) | 10 lines Merged revisions 890465 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r890465 | dkulp | 2009-12-14 15:05:02 -0500 (Mon, 14 Dec 2009) | 2 lines [CXF-2035] Make sure the element name matches the operation defined by the Actions ........ ................ 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/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImpl.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=890624&r1=890623&r2=890624&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 Dec 15 03:18:28 2009 @@ -100,7 +100,7 @@ // 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)) { + if (!msgInfo.getMessageParts().get(0).getConcreteName().equals(startQName)) { throw new Fault("UNEXPECTED_WRAPPER_ELEMENT", LOG, null, startQName, msgInfo.getMessageParts().get(0).getConcreteName()); } Modified: cxf/branches/2.1.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.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java?rev=890624&r1=890623&r2=890624&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java (original) +++ cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/WSAFromJavaTest.java Tue Dec 15 03:18:28 2009 @@ -150,4 +150,20 @@ return service.getAddNumberImplPort(); } + + @Test + public void testUnmatchedActions() throws Exception { + AddNumberImpl port = getPort(); + + BindingProvider bp = (BindingProvider)port; + java.util.Map<String, Object> requestContext = bp.getRequestContext(); + requestContext.put(BindingProvider.SOAPACTION_URI_PROPERTY, + "http://cxf.apache.org/input4"); + try { + //CXF-2035 + port.addNumbers3(-1, -1); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Unexpected wrapper")); + } + } } \ No newline at end of file Modified: cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImpl.java?rev=890624&r1=890623&r2=890624&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImpl.java (original) +++ cxf/branches/2.1.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/AddNumberImpl.java Tue Dec 15 03:18:28 2009 @@ -19,6 +19,7 @@ package org.apache.cxf.systest.ws.addr_fromjava.server; +import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.ws.Action; import javax.xml.ws.FaultAction; @@ -43,10 +44,19 @@ @Action(input = "http://cxf.apache.org/input3", output = "http://cxf.apache.org/output3", fault = {...@faultaction(className = AddNumbersException.class, value = "http://cxf.apache.org/fault3") }) + @WebMethod(action = "http://cxf.apache.org/input3") public int addNumbers3(int number1, int number2) throws AddNumbersException { return execute(number1, number2); } + @Action(input = "http://cxf.apache.org/input4", output = "http://cxf.apache.org/output4", + fault = {...@faultaction(className = AddNumbersException.class, + value = "http://cxf.apache.org/fault4") }) + @WebMethod(action = "http://cxf.apache.org/input4") + public int addNumbers4(int number1, int number2) throws AddNumbersException { + return number1 + number2; + } + int execute(int number1, int number2) throws AddNumbersException { if (number1 < 0 || number2 < 0) { throw new AddNumbersException("Negative numbers can't be added!",
