cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: [CXF-5888] Check for attributes on base types when unwrapping operations
Date Thu, 17 Jul 2014 15:49:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4daba03ba -> 7df90539a


[CXF-5888] Check for attributes on base types when unwrapping operations


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7df90539
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7df90539
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7df90539

Branch: refs/heads/master
Commit: 7df90539a5c784d8950c9d19bca87f7fc6747c79
Parents: 4daba03
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Jul 17 11:47:12 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Jul 17 11:48:09 2014 -0400

----------------------------------------------------------------------
 .../apache/cxf/wsdl11/WSDLServiceBuilder.java   | 50 ++++++++++----------
 1 file changed, 26 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7df90539/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
index f48ff08..577fe71 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
@@ -792,32 +792,34 @@ public class WSDLServiceBuilder {
 
     private static boolean isWrappableSequence(XmlSchemaComplexType type, String namespaceURI,
                                                MessageInfo wrapper, boolean allowRefs) {
-        if (type.getParticle() instanceof XmlSchemaSequence) {
-            XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
-            return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
-        } else if (type.getParticle() == null) {
-            if (type.getContentModel() == null) {
-                return true;
-            }
-            if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension)
{
-                XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
-                    .getContentModel().getContent();
-                QName baseTypeName = extension.getBaseTypeName();
-                ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
-                XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
-                if (!(schemaType instanceof XmlSchemaComplexType)
-                    || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI,
wrapper,
-                                            allowRefs)) {
-                    return false;
+        if (!hasAttributes(type)) {
+            if (type.getParticle() instanceof XmlSchemaSequence) {
+                XmlSchemaSequence seq = (XmlSchemaSequence)type.getParticle();
+                return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
+            } else if (type.getParticle() == null) {
+                if (type.getContentModel() == null) {
+                    return true;
                 }
-                             
-                if (extension.getParticle() instanceof XmlSchemaSequence) {
-                    XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
-                    return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
-                }  
-                
+                if (type.getContentModel().getContent() instanceof XmlSchemaComplexContentExtension)
{
+                    XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)type
+                        .getContentModel().getContent();
+                    QName baseTypeName = extension.getBaseTypeName();
+                    ServiceInfo serviceInfo = wrapper.getOperation().getInterface().getService();
+                    XmlSchemaType schemaType = serviceInfo.getXmlSchemaCollection().getTypeByQName(baseTypeName);
+                    if (!(schemaType instanceof XmlSchemaComplexType)
+                        || !isWrappableSequence((XmlSchemaComplexType)schemaType, namespaceURI,
wrapper,
+                                                allowRefs)) {
+                        return false;
+                    }
+                                 
+                    if (extension.getParticle() instanceof XmlSchemaSequence) {
+                        XmlSchemaSequence seq = (XmlSchemaSequence)extension.getParticle();
+                        return buildMessageParts(seq, namespaceURI, wrapper, allowRefs);
+                    }  
+                    
+                }
+                return true;
             }
-            return true;
         }
         return false;
     }


Mime
View raw message