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 2009/07/28 03:17:58 UTC

svn commit: r798351 - in /cxf/branches/2.1.x-fixes: ./ api/src/main/java/org/apache/cxf/tools/common/ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ rt/core/src/main/java/org/apache/cxf/wsdl11/ tools/wsdlto/core/src/main/java/o...

Author: dkulp
Date: Tue Jul 28 01:17:57 2009
New Revision: 798351

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

................
  r798348 | dkulp | 2009-07-27 21:10:19 -0400 (Mon, 27 Jul 2009) | 10 lines
  
  Merged revisions 798344 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r798344 | dkulp | 2009-07-27 21:07:11 -0400 (Mon, 27 Jul 2009) | 2 lines
    
    [CXF-1079] Add option to allow element refs when checking for ability to
    unwrap.
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
    cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 28 01:17:57 2009
@@ -1,2 +1,2 @@
-/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790651,790654-790655,790659,791948,791950,791952,791955,792276,792288,792291,792992,792995,792998,794402,794404,794735,794797,794799,794803,795161-795162,796300-796301,796598,797449,797452-797453,797460,797463-797464,797521-797522,797584-797585,797645,797652,797701,797884,797886
-/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790644,791354,791538,791753,791947,792261-792263,792684,792975,792985,794297,794396,794728,794778-794780,794892,795160,796022-796023,796593,796780,797194,797231-797233,797442,797505,797517,797581-797582,797640,797651,797699,797882-797883
+/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790651,790654-790655,790659,791948,791950,791952,791955,792276,792288,792291,792992,792995,792998,794402,794404,794735,794797,794799,794803,795161-795162,796300-796301,796598,797449,797452-797453,797460,797463-797464,797521-797522,797584-797585,797645,797652,797701,797884,797886,798348
+/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790644,791354,791538,791753,791947,792261-792263,792684,792975,792985,794297,794396,794728,794778-794780,794892,795160,796022-796023,796593,796780,797194,797231-797233,797442,797505,797517,797581-797582,797640,797651,797699,797882-797883,798344

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

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java (original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java Tue Jul 28 01:17:57 2009
@@ -89,6 +89,7 @@
     public static final String CFG_LIB_REF = "library.references";
     public static final String CFG_ANT_PROP = "ant.prop";
     public static final String CFG_NO_ADDRESS_BINDING = "noAddressBinding";
+    public static final String CFG_ALLOW_ELEMENT_REFS = "allowElementReferences";
 
 
 
@@ -107,7 +108,6 @@
     public static final String CFG_GEN_NEW_ONLY = "newonly";
 
     // Java2WSDL Constants
-
     public static final String CFG_CLASSPATH = "classpath";
     public static final String CFG_TNS = "tns";
     public static final String CFG_SERVICENAME = "servicename";

Modified: cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java (original)
+++ cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java Tue Jul 28 01:17:57 2009
@@ -140,6 +140,11 @@
      * Disable generation of service address binding in the generated Java classes
      */
     boolean noAddressBinding;
+    
+    /**
+     * Allow element references when determining if an operation can be unwrapped or not 
+     */
+    boolean allowElementRefs;
 
 
     public Option() {
@@ -315,6 +320,14 @@
         this.noAddressBinding = noAddressBinding;
     }
 
+    public boolean isAllowElementRefs() {
+        return allowElementRefs;
+    }
+
+    public void setAllowElementRefs(boolean allowElementRefs) {
+        this.allowElementRefs = allowElementRefs;
+    }
+
     public void copyOptions(Option destination) {
         destination.setAutoNameResolution(isAutoNameResolution());
         destination.setBindingFiles(getBindingFiles());
@@ -333,6 +346,7 @@
         destination.setPackagenames(getPackagenames());
         destination.setServiceName(getServiceName());
         destination.setValidateWsdl(isValidateWsdl());
+        destination.setAllowElementRefs(isAllowElementRefs());
         if (isSetWsdlLocation()) {
             destination.setWsdlLocation(getWsdlLocation());
         }

Modified: cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java (original)
+++ cxf/branches/2.1.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Tue Jul 28 01:17:57 2009
@@ -422,6 +422,10 @@
         }
         if (wsdlOption.isExtendedSoapHeaders()) {
             list.add("-exsh");
+            list.add("true");
+        }
+        if (wsdlOption.isAllowElementRefs()) {
+            list.add("-allowElementRefs");
         }
         if (wsdlOption.isValidateWsdl()) {
             list.add("-validate");

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Tue Jul 28 01:17:57 2009
@@ -102,6 +102,7 @@
     private Bus bus;
     private Map<String, Element> schemaList = new HashMap<String, Element>();
     private boolean recordOriginal = true;
+    private boolean allowRefs;
     private boolean ignoreUnknownBindings;
 
     public WSDLServiceBuilder(Bus bus) {
@@ -115,6 +116,9 @@
     public void setIgnoreUnknownBindings(boolean b) {
         ignoreUnknownBindings = b;
     }
+    public void setAllowElementRefs(boolean b) {
+        allowRefs = b;
+    }
     
     private void copyExtensors(AbstractPropertiesHolder info, List<?> extList) {
         if (info != null) {
@@ -582,10 +586,13 @@
             copyExtensors(finfo, entry.getValue().getExtensibilityElements());
             copyExtensionAttributes(finfo, entry.getValue());
         }
-        checkForWrapped(opInfo, false);
+        checkForWrapped(opInfo, allowRefs, false);
     }
 
     public static void checkForWrapped(OperationInfo opInfo, boolean relaxed) {
+        checkForWrapped(opInfo, relaxed, relaxed);
+    }
+    public static void checkForWrapped(OperationInfo opInfo, boolean allowRefs, boolean relaxed) {
         MessageInfo inputMessage = opInfo.getInput();
         MessageInfo outputMessage = opInfo.getOutput();
         boolean passedRule = true;
@@ -659,7 +666,7 @@
             if (hasAttributes(xsct)
                 || (inputEl.isNillable() && !relaxed)
                 || !isWrappableSequence(xsct, inputEl.getQName().getNamespaceURI(),
-                                        unwrappedInput, relaxed)) {
+                                        unwrappedInput, allowRefs)) {
                 passedRule = false;
             }
         } else {
@@ -681,7 +688,7 @@
                 if (hasAttributes(xsct)
                     || (outputEl.isNillable() && !relaxed)
                     || !isWrappableSequence(xsct, outputEl.getQName().getNamespaceURI(), unwrappedOutput,
-                                            relaxed)) {
+                                            allowRefs)) {
                     passedRule = false;
                 }
             } else {

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java (original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java Tue Jul 28 01:17:57 2009
@@ -170,6 +170,17 @@
 
                 WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
                 serviceBuilder.setIgnoreUnknownBindings(true);
+                String allowRefs = (String)context.get(ToolConstants.CFG_ALLOW_ELEMENT_REFS);
+                if (!StringUtils.isEmpty(allowRefs) 
+                    || context.optionSet(ToolConstants.CFG_ALLOW_ELEMENT_REFS)) {
+                    if (allowRefs.length() > 0 && allowRefs.charAt(0) == '=') {
+                        allowRefs = allowRefs.substring(1);
+                    }
+                    if (StringUtils.isEmpty(allowRefs)) {
+                        allowRefs = "true";
+                    }
+                    serviceBuilder.setAllowElementRefs(Boolean.valueOf(allowRefs));
+                }
                 String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);
 
                 if (serviceName != null) {

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml?rev=798351&r1=798350&r2=798351&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml (original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml Tue Jul 28 01:17:57 2009
@@ -171,6 +171,17 @@
                 </annotation>
                 <switch>autoNameResolution</switch>
             </option>
+            
+            <option id="allowElementReferences" maxOccurs="1">
+            	<annotaion>
+            	</annotaion>
+            	<associatedArgument placement="immediate">
+                    <annotation>=true</annotation>
+                    <valueenum>true|false</valueenum>
+                </associatedArgument>
+            	<switch>allowElementReferences</switch>
+            	<switch>aer</switch>
+            </option>
 
 	        <option id="defaultValues" maxOccurs="1">
                 <annotation>