cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1164140 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Date Thu, 01 Sep 2011 16:33:08 GMT
Author: dkulp
Date: Thu Sep  1 16:33:08 2011
New Revision: 1164140

URL: http://svn.apache.org/viewvc?rev=1164140&view=rev
Log:
[CXF-2053] -verbose logging of more information when not unwrapping an
operation

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties?rev=1164140&r1=1164139&r2=1164140&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/Messages.properties Thu Sep  1 16:33:08
2011
@@ -33,4 +33,9 @@ MISSING_SERVICE= No definition of servic
 WSDL4J_BAD_ELEMENT_PART= Part {0} defined as element {1} which is not in the schema.
 PART_NO_NAME_NO_TYPE= Part {0} defined with no element and no type.
 NO_MESSAGE=No {0} message was found for operation {1} and input named {2}.  Check the wsdl
for errors.
-BINDING_MISSING_TYPE=Could not find portType for binding {0}. Check wsdl for errors.
\ No newline at end of file
+BINDING_MISSING_TYPE=Could not find portType for binding {0}. Check wsdl for errors.
+WRAPPED_RULE_1 = Operation {0} cannot be unwrapped, input and output messages (if present)
must contain only a single part
+WRAPPED_RULE_2 = Operation {0} cannot be unwrapped, input message must reference global element
declaration with same localname as operation
+WRAPPED_RULE_3 = Operation {0} cannot be unwrapped, output message must reference global
element declaration
+WRAPPED_RULE_4 = Operation {0} cannot be unwrapped, its wsdl:part/@element reference must
match xs:complexType/xs:sequence
+WRAPPED_RULE_5 = Operation {0} cannot be unwrapped, its wsdl:part/@element may only contain
xs:sequences of xs:element[@name and not(@nillable)]
\ No newline at end of file

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=1164140&r1=1164139&r2=1164140&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 Thu Sep
 1 16:33:08 2011
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.wsdl.Binding;
@@ -109,6 +110,7 @@ public class WSDLServiceBuilder {
     private boolean recordOriginal = true;
     private boolean allowRefs;
     private boolean ignoreUnknownBindings;
+    private Level unwrapLogLevel = Level.FINE;
 
     public WSDLServiceBuilder(Bus bus) {
         this.bus = bus;
@@ -118,6 +120,9 @@ public class WSDLServiceBuilder {
         recordOriginal = record;
     }
 
+    public void setUnwrapLogLevel(Level l) {
+        unwrapLogLevel = l;
+    }
     public void setIgnoreUnknownBindings(boolean b) {
         ignoreUnknownBindings = b;
     }
@@ -491,7 +496,7 @@ public class WSDLServiceBuilder {
             copyExtensionAttributes(bi, binding);
 
             for (BindingOperation bop : cast(binding.getBindingOperations(), BindingOperation.class))
{
-                LOG.fine("binding operation name is " + bop.getName());
+                LOG.finer("binding operation name is " + bop.getName());
                 String inName = null;
                 String outName = null;
                 if (bop.getBindingInput() != null) {
@@ -614,13 +619,18 @@ public class WSDLServiceBuilder {
             copyExtensors(finfo, entry.getValue().getExtensibilityElements());
             copyExtensionAttributes(finfo, entry.getValue());
         }
-        checkForWrapped(opInfo, allowRefs, false);
+        checkForWrapped(opInfo, allowRefs, false, unwrapLogLevel);
     }
 
     public static void checkForWrapped(OperationInfo opInfo, boolean relaxed) {
         checkForWrapped(opInfo, relaxed, relaxed);
     }
     public static void checkForWrapped(OperationInfo opInfo, boolean allowRefs, boolean relaxed)
{
+        checkForWrapped(opInfo, allowRefs, relaxed, Level.FINE);
+    }
+
+    public static void checkForWrapped(OperationInfo opInfo, boolean allowRefs,
+                                       boolean relaxed, Level logLevel) {
         MessageInfo inputMessage = opInfo.getInput();
         MessageInfo outputMessage = opInfo.getOutput();
         boolean passedRule = true;
@@ -637,6 +647,9 @@ public class WSDLServiceBuilder {
         }
 
         if (!passedRule) {
+            org.apache.cxf.common.i18n.Message message 
+                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_1", LOG, opInfo.getName());
+            LOG.log(logLevel, message.toString());
             return;
         }
         SchemaCollection schemas = opInfo.getInterface().getService().getXmlSchemaCollection();
@@ -660,6 +673,9 @@ public class WSDLServiceBuilder {
         }
 
         if (!passedRule) {
+            org.apache.cxf.common.i18n.Message message 
+                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_2", LOG, opInfo.getName());
+            LOG.log(logLevel, message.toString());
             return;
         }
         // RULE No.3:
@@ -678,6 +694,9 @@ public class WSDLServiceBuilder {
         }
 
         if (!passedRule) {
+            org.apache.cxf.common.i18n.Message message 
+                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_3", LOG, opInfo.getName());
+            LOG.log(logLevel, message.toString());
             return;
         }
         // RULE No.4 and No5:
@@ -705,6 +724,9 @@ public class WSDLServiceBuilder {
         }
 
         if (!passedRule) {
+            org.apache.cxf.common.i18n.Message message 
+                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_4", LOG, opInfo.getName());
+            LOG.log(logLevel, message.toString());
             return;
         }
 
@@ -728,6 +750,9 @@ public class WSDLServiceBuilder {
         }
 
         if (!passedRule) {
+            org.apache.cxf.common.i18n.Message message 
+                = new org.apache.cxf.common.i18n.Message("WRAPPED_RULE_5", LOG, opInfo.getName());
+            LOG.log(logLevel, message.toString());
             return;
         }
         // we are wrappable!!

Modified: cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?rev=1164140&r1=1164139&r2=1164140&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Thu Sep  1 16:33:08 2011
@@ -177,6 +177,9 @@ public class WSDLToJavaContainer extends
                 builder.validate(definition);
 
                 WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
+                if (context.isVerbose()) {
+                    serviceBuilder.setUnwrapLogLevel(Level.INFO);
+                }
                 serviceBuilder.setIgnoreUnknownBindings(true);
                 String allowRefs = (String)context.get(ToolConstants.CFG_ALLOW_ELEMENT_REFS);
                 if (!StringUtils.isEmpty(allowRefs) 



Mime
View raw message