cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r920568 - in /cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ systests/jaxws/src/test/java/org/...
Date Mon, 08 Mar 2010 23:40:41 GMT
Author: dkulp
Date: Mon Mar  8 23:40:41 2010
New Revision: 920568

URL: http://svn.apache.org/viewvc?rev=920568&view=rev
Log:
[CXF-2692] Fix NPE with meethod with only header param

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.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/DocLitWrappedCodeFirstService.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?rev=920568&r1=920567&r2=920568&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Mon Mar  8 23:40:41 2010
@@ -215,6 +215,9 @@
 
             for (SoapHeaderInfo header : headers) {
                 MessagePartInfo part = header.getPart();
+                if (wrappedBmi != bmi) {
+                    part = wrappedBmi.getMessageInfo().addMessagePart(part.getName());
+                }
                 if (part.getIndex() >= objs.size()) {
                     // The optional out of band header is not a part of parameters of the
method
                     continue;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=920568&r1=920567&r2=920568&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Mon Mar
 8 23:40:41 2010
@@ -617,8 +617,11 @@
         // The operation's input and output message (if present) each contain
         // only a single part
         // input message must exist
-        if (inputMessage == null || inputMessage.size() != 1
-            || (outputMessage != null && outputMessage.size() > 1)) {
+        if (inputMessage == null || inputMessage.size() == 0 
+            || (inputMessage.size() > 1 && !relaxed)) {
+            passedRule = false;
+        }
+        if (outputMessage != null && outputMessage.size() > 1) {
             passedRule = false;
         }
 

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=920568&r1=920567&r2=920568&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Mon Mar  8 23:40:41 2010
@@ -801,6 +801,7 @@
                                      Class paramType, Type genericType) {
         boolean isIn = isInParam(method, i);
         boolean isOut = isOutParam(method, i);
+        boolean isHeader = isHeader(method, i);
         Annotation[] paraAnnos = null;
         if (i != -1 && o.getProperty(METHOD_PARAM_ANNOTATIONS) != null) {
             Annotation[][] anns = (Annotation[][])o.getProperty(METHOD_PARAM_ANNOTATIONS);
@@ -816,6 +817,20 @@
             if (part == null && isFromWsdl()) {
                 part = o.getInput().getMessagePartByIndex(i);
             }
+            if (part == null && isHeader && o.isUnwrapped()) {
+                part = ((UnwrappedOperationInfo)o).getWrappedOperation().getInput().getMessagePart(name);
+                if (part != null) {
+                    //header part in wsdl, need to get this mapped in to the unwrapped form
+                    MessagePartInfo inf = o.getInput().addMessagePart(part.getName());
+                    inf.setTypeQName(part.getTypeQName());
+                    inf.setElement(part.isElement());
+                    inf.setElementQName(part.getElementQName());
+                    inf.setConcreteName(part.getConcreteName());
+                    inf.setXmlSchema(part.getXmlSchema());
+                    part = inf;
+                    inf.setProperty(HEADER, Boolean.TRUE);
+                }
+            }
             if (part == null) {
                 return false;
             }
@@ -840,6 +855,9 @@
             if (part == null && this.isFromWsdl()) {
                 part = o.getInput().getMessagePartByIndex(i);
             }
+            if (part == null && isHeader && o.isUnwrapped()) {
+                part = o.getUnwrappedOperation().getInput().getMessagePart(name);
+            }
             if (part == null) {
                 return false;
             }

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=920568&r1=920567&r2=920568&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
Mon Mar  8 23:40:41 2010
@@ -425,6 +425,7 @@
         assertEquals("Hello", echoMsg);
     }
     private void runDocLitTest(DocLitWrappedCodeFirstService port) throws Exception {
+        assertEquals("snarf", port.doBug2692("snarf"));
         CXF2411Result<CXF2411SubClass> o = port.doCXF2411();
         assertNotNull(o);
         assertNotNull(o.getContent());
@@ -433,7 +434,6 @@
         Foo foo = new Foo();
         foo.setName("blah");
         assertEquals("blah", port.modifyFoo(foo).getName());
-        
 
         assertEquals("hello", port.outOnly(new Holder<String>(), new Holder<String>()));
         

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=920568&r1=920567&r2=920568&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Mon Mar  8 23:40:41 2010
@@ -195,6 +195,10 @@
         }
     }
     
+    @WebResult(name = "return")
+    String doBug2692(@WebParam(name = "name", header = true) String name);
+
+    
     Set<Foo> getFooSet();
     
     Foo modifyFoo(Foo foo);

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=920568&r1=920567&r2=920568&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Mon Mar  8 23:40:41 2010
@@ -236,5 +236,9 @@
         ret.setContent(content);
         return ret;
     }
+
+    public String doBug2692(String name) {
+        return name;
+    }
     
 }



Mime
View raw message