cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1454046 - /cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
Date Thu, 07 Mar 2013 19:40:35 GMT
Author: dkulp
Date: Thu Mar  7 19:40:35 2013
New Revision: 1454046

URL: http://svn.apache.org/r1454046
Log:
Merged revisions 1454031 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1454031 | dkulp | 2013-03-07 14:27:26 -0500 (Thu, 07 Mar 2013) | 18 lines

  Merged revisions 1454023 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

  ........
    r1454023 | dkulp | 2013-03-07 14:23:20 -0500 (Thu, 07 Mar 2013) | 10 lines

    Merged revisions 1454010 via  git cherry-pick from
    https://svn.apache.org/repos/asf/cxf/trunk

    ........
      r1454010 | dkulp | 2013-03-07 14:12:35 -0500 (Thu, 07 Mar 2013) | 2 lines

      [CXF-4019] Remove some code that definitely doesn't work correctly

    ........

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java

Modified: cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java?rev=1454046&r1=1454045&r2=1454046&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/javascript/javascript-rt/src/main/java/org/apache/cxf/javascript/service/ServiceJavascriptBuilder.java
Thu Mar  7 19:40:35 2013
@@ -55,11 +55,9 @@ import org.apache.cxf.service.model.Mess
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaAny;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaObject;
-import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaSequenceMember;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
@@ -532,13 +530,18 @@ public class ServiceJavascriptBuilder ex
                     .appendLine("var returnObject = "
                                 + typeObjectName
                                 + "_deserialize (cxfjsutils, partElement);\n");
+                utils.appendLine("return returnObject;");
             } else if (type instanceof XmlSchemaSimpleType) {
                 XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)type;
                 utils.appendLine("var returnText = cxfjsutils.getNodeText(partElement);");
                 utils.appendLine("var returnObject = "
                                  + utils.javascriptParseExpression(simpleType, "returnText")
+ ";");
+                utils.appendLine("return returnObject;");
+            } else if (type != null) {
+                utils.appendLine("// Unsupported construct " + type.getClass());
+            } else {
+                utils.appendLine("// No type for element " + element.getXmlName());
             }
-            utils.appendLine("return returnObject;");
         }
         code.append("}\n");
     }
@@ -680,19 +683,6 @@ public class ServiceJavascriptBuilder ex
         return false;
     }
 
-    private XmlSchemaParticle getBuriedElement(XmlSchemaComplexType type,
-                                              QName parentName) {
-        XmlSchemaSequence sequence = getTypeSequence(type, parentName);
-        List<XmlSchemaSequenceMember> insides = sequence.getItems();
-        if (insides.size() == 1) {
-            XmlSchemaSequenceMember item = insides.get(0);
-            if (item instanceof XmlSchemaElement || item instanceof XmlSchemaAny) {
-                return (XmlSchemaParticle) item;
-            }
-        }
-        return null;
-    }
-
     /**
      * Collect information about the parts of an unwrapped message.
      * @param parts
@@ -728,32 +718,6 @@ public class ServiceJavascriptBuilder ex
             }
 
             boolean empty = isEmptyType(type, diagnosticName);
-            // There's something funny about doc/bare. Since it's doc, there is no
-            // element in the part. There is a type. However, for some reason,
-            // it tends to be an anonymous complex type containing an element, and that
-            // element corresponds to the type of the parameter. So, we refocus on that.
-            if (!empty
-                && type instanceof XmlSchemaComplexType
-                && type.getName() == null
-                && !isWrapped) {
-                XmlSchemaParticle betterElement = getBuriedElement((XmlSchemaComplexType)
type,
-                                                                  diagnosticName);
-                if (betterElement instanceof XmlSchemaElement) {
-                    element = (XmlSchemaElement)betterElement;
-                    if (element.getSchemaType() == null) {
-                        if (element.getSchemaTypeName() != null) {
-                            element.setSchemaType(xmlSchemaCollection
-                                                  .getTypeByQName(element.getSchemaTypeName()));
-                        } else if (element.getRef().getTargetQName() != null
-                            && element.getRef().getTarget().getSchemaTypeName() !=
null) {
-                            element = element.getRef().getTarget();
-                            element.setSchemaType(xmlSchemaCollection
-                                                  .getTypeByQName(element.getSchemaTypeName()));
-                        }
-                    }
-                    type = element.getSchemaType();
-                }
-            }
 
             String partJavascriptVar =
                 JavascriptUtils.javaScriptNameToken(mpi.getConcreteName().getLocalPart());



Mime
View raw message