cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r589916 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/common/util/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/javascript/ rt/javascript/src/main/java/org/apache/cxf/javascript/ rt/javascript/src...
Date Tue, 30 Oct 2007 00:10:51 GMT
Author: bimargulies
Date: Mon Oct 29 17:10:38 2007
New Revision: 589916

URL: http://svn.apache.org/viewvc?rev=589916&view=rev
Log:
1) 'First light' on Javascript generation. Generate a working serialization function for a
POJO class.
2) Rather a lumbering test harness, using Rhino, to unit test this stuff.
3) Move 'capitalize' from AnnotationUtil to StringUtils for more general usability.
4) Upgrade to next Rhino to get diagnostic function.

Added:
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/
    incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedUnqualified.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/package-info.html
    incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTest.js
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/javascript/pom.xml
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/BasicNameManager.java
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTests.java
    incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTestBeans.xml
    incubator/cxf/trunk/systests/pom.xml
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaClass.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StringUtils.java
Mon Oct 29 17:10:38 2007
@@ -208,4 +208,18 @@
         }                
         return urlString;
     }
+ 
+    /**
+     * Return input string with first character in upper case.
+     * @param name input string.
+     * @return capitalized form.
+     */
+    public static String capitalize(String name) {
+        if (name == null || name.length() == 0) {
+            return name;
+        }
+        char chars[] = name.toCharArray();
+        chars[0] = Character.toUpperCase(chars[0]);
+        return new String(chars);
+    }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Mon Oct 29 17:10:38 2007
@@ -49,7 +49,6 @@
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.OperationInfo;
-import org.apache.cxf.tools.util.AnnotationUtil;
 
 public class JaxWsServiceConfiguration extends AbstractServiceConfiguration {
 
@@ -497,7 +496,7 @@
         ResponseWrapper rw = m.getAnnotation(ResponseWrapper.class);
         String clsName = "";
         if (rw == null) {
-            clsName = getPackageName(selected) + ".jaxws." + AnnotationUtil.capitalize(selected.getName())
+            clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName())
                       + "Response";
         } else {
             clsName = rw.className();
@@ -549,7 +548,7 @@
         RequestWrapper rw = m.getAnnotation(RequestWrapper.class);
         String clsName = "";
         if (rw == null) {
-            clsName = getPackageName(selected) + ".jaxws." + AnnotationUtil.capitalize(selected.getName());
+            clsName = getPackageName(selected) + ".jaxws." + StringUtils.capitalize(selected.getName());
         } else {
             clsName = rw.className();
         }

Modified: incubator/cxf/trunk/rt/javascript/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/pom.xml?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/pom.xml (original)
+++ incubator/cxf/trunk/rt/javascript/pom.xml Mon Oct 29 17:10:38 2007
@@ -137,6 +137,12 @@
             <version>${spring.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+           <groupId>rhino</groupId>
+           <artifactId>js</artifactId>
+           <version>1.6R6</version>
+           <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/BasicNameManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/BasicNameManager.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/BasicNameManager.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/BasicNameManager.java
Mon Oct 29 17:10:38 2007
@@ -24,6 +24,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.namespace.QName;
+
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
@@ -55,16 +57,28 @@
         }
         
         for (String uri : poorPrefixURIs) {
-            // this needs more work later. We are bound to annoy someone somehow in this
area.
-            String jsPrefix = uri.replace("http:", "").replace("uri:", "").replaceAll("[\\.:/-]",
"_");
-            nsPrefixMap.put(uri, jsPrefix.toUpperCase());
+            defineFallbackPrefix(uri);
         }
     }
 
+    private String defineFallbackPrefix(String uri) {
+        // this needs more work later. We are bound to annoy someone somehow in this area.
+        String jsPrefix = uri.replace("http:", "").replace("uri:", "").replaceAll("[\\.:/-]",
"_");
+        nsPrefixMap.put(uri, jsPrefix);
+        return jsPrefix;
+    }
+
     /** {@inheritDoc}*/
     public String getJavascriptName(XmlSchemaComplexType schemaType) {
-        return nsPrefixMap.get(schemaType.getQName().getNamespaceURI()) 
+        QName typeQName = schemaType.getQName();
+        String nsprefix = nsPrefixMap.get(typeQName.getNamespaceURI());
+        // nsprefix will be null if there is no prefix.
+        if (nsprefix == null) {
+            nsprefix = defineFallbackPrefix(typeQName.getNamespaceURI());
+        }
+        return nsprefix 
+               + "_"
         //TODO: the local part of the name may be a problem for JavaScript.
-                               + schemaType.getQName().getLocalPart();
+               + schemaType.getQName().getLocalPart();
     }
 }

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/JavascriptUtils.java
Mon Oct 29 17:10:38 2007
@@ -25,8 +25,6 @@
 import java.util.Set;
 import java.util.Stack;
 
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
-
 /**
  * 
  */
@@ -55,17 +53,19 @@
         prefixStack.push("    ");
     }
     
-    public String getDefaultValueForSimpleType(XmlSchemaSimpleType type) {
-        String val = defaultValueForSimpleType.get(type.getName());
-        if (val == null) {
+    // the next two functions operate by name to get around XmlSchema quirk.
+    
+    public String getDefaultValueForSimpleType(String typeName) {
+        String val = defaultValueForSimpleType.get(typeName);
+        if (val == null) { // ints and such return the appropriate 0.
             return "''";
         } else {
             return val;
         }
     }
     
-    public boolean isStringSimpleType(XmlSchemaSimpleType type) {
-        return !nonStringSimpleTypes.contains(type.getName());
+    public boolean isStringSimpleType(String typeName) {
+        return !nonStringSimpleTypes.contains(typeName);
     }
     
     public void setXmlStringAccumulator(String variableName) {
@@ -77,7 +77,7 @@
         code.append(prefix());
         code.append("var ");
         code.append(variableName);
-        code.append(";" + NL);
+        code.append(" = '';" + NL);
     }
     
     public static String protectSingleQuotes(String value) {

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
Mon Oct 29 17:10:38 2007
@@ -30,6 +30,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.javascript.JavascriptUtils;
 import org.apache.cxf.javascript.NameManager;
 import org.apache.cxf.javascript.UnsupportedSchemaConstruct;
@@ -42,7 +43,6 @@
 import org.apache.ws.commons.schema.XmlSchemaObjectTable;
 import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
 /**
@@ -60,7 +60,6 @@
     private static final String XSI_NS_ATTR = WSDLConstants.NP_XMLNS + ":" 
         + WSDLConstants.NP_SCHEMA_XSI + "='" + WSDLConstants.NU_SCHEMA_XSI + "'";
     private static final String NIL_ATTRIBUTES = XSI_NS_ATTR + " xsi:nil='true'";
-    // The schema that we are operating upon.
     private SchemaInfo schemaInfo;
     private NameManager nameManager;
     private Map<String, String> fallbackNamespacePrefixMap;
@@ -174,6 +173,9 @@
     
     public String generateCodeForSchema(SchemaInfo schema) {
         StringBuffer code = new StringBuffer();
+        code.append("//\n");
+        code.append("// Definitions for schema: " + schema.toString() + "\n");
+        code.append("//\n");
 
         XmlSchemaObjectTable schemaTypes = schema.getSchema().getSchemaTypes();
         Iterator namesIterator = schemaTypes.getNames();
@@ -194,6 +196,20 @@
         return code.toString();
     }
     
+    /**
+     * If you ask an XmlSchemaElement for a type object, and the object is of simple type,

+     * the answer appears to be, in some cases,
+     * null! The name, however, is OK. Since all we need is the name, this function 
+     * encapsulates the workaround. 
+     * @param element
+     * @return
+     */
+    private String getElementSimpleTypeName(XmlSchemaElement element) {
+        QName typeName = element.getSchemaTypeName();
+        assert WSDLConstants.NU_SCHEMA_XSD.equals(typeName.getNamespaceURI());
+        return typeName.getLocalPart();
+    }
+    
     public String complexTypeConstructorAndAccessors(XmlSchemaComplexType type) {
         StringBuffer code = new StringBuffer();
         StringBuffer accessors = new StringBuffer();
@@ -203,7 +219,7 @@
         final String elementPrefix = "this._";
         
         String typeObjectName = nameManager.getJavascriptName(type);
-        code.append(typeObjectName + " () {\n");
+        code.append("function " + typeObjectName + " () {\n");
         
         if (particle == null) {
             unsupportedConstruct("NULL_PARTICLE", type);
@@ -231,14 +247,18 @@
             // Assume that no lunatic has created multiple elements that differ only by namespace.
             // if elementForm is unqualified, how can that be valid?
             String elementName = elementPrefix + elChild.getName();
+            String accessorSuffix = StringUtils.capitalize(elChild.getName());
 
-            String accessorName = typeObjectName + "_get" + elChild.getName();
-            accessors.append(accessorName + "() { return " + elementName + ";}\n");
-            accessors.append(typeObjectName + ".get" + elChild.getName() + " = " + accessorName
+ ";\n");
+            String accessorName = typeObjectName + "_get" + accessorSuffix;
+            accessors.append("function " + accessorName + "() { return " + elementName +
";}\n");
+            accessors.append(typeObjectName + ".prototype.get" 
+                             + accessorSuffix + " = " + accessorName + ";\n");
             
-            accessorName = typeObjectName + "_set" + elChild.getName();
-            accessors.append(accessorName + "(value) {" + elementName + " = value;}\n");
-            accessors.append(typeObjectName + ".set" + elChild.getName() + " = " + accessorName
+ ";\n");
+            accessorName = typeObjectName + "_set" + accessorSuffix;
+            accessors.append("function " 
+                             + accessorName + "(value) {" + elementName + " = value;}\n");
+            accessors.append(typeObjectName 
+                             + ".prototype.set" + accessorSuffix + " = " + accessorName +
";\n");
             
             if (isParticleOptional(elChild) || (nillable && !isParticleArray(elChild)))
{
                 utils.appendLine(elementName + " = null;");
@@ -253,7 +273,7 @@
                 String defaultValueString = elChild.getDefaultValue();
                 if (defaultValueString == null) {
                     defaultValueString = 
-                        utils.getDefaultValueForSimpleType((XmlSchemaSimpleType)elChild.getSchemaType());
+                        utils.getDefaultValueForSimpleType(getElementSimpleTypeName(elChild));
                 }
                 utils.appendLine(elementName + " = " + defaultValueString + ";");
             }
@@ -282,7 +302,7 @@
         StringBuffer code = new StringBuffer();
         JavascriptUtils utils = new JavascriptUtils(code);
         String functionName = nameManager.getJavascriptName(type) + "_" + "serialize";
-        code.append(functionName + "(elementName) {\n");
+        code.append("function " + functionName + "(cxfjsutils, elementName) {\n");
         utils.startXmlStringAccumulator("xml");
         utils.startIf("elementName != null");
         utils.appendString("<");
@@ -301,9 +321,10 @@
         utils.appendExpression("elementName");
         utils.appendString(">");
         utils.endBlock();
+        code.append("return xml;\n");
         code.append("}\n");
 
-        code.append(nameManager.getJavascriptName(type) + ".serialize = " + functionName
+ ";\n");
+        code.append(nameManager.getJavascriptName(type) + ".prototype.serialize = " + functionName
+ ";\n");
         return code.toString();
     }
    
@@ -365,13 +386,14 @@
             
             // now for the thing itself.
             if (elType instanceof XmlSchemaComplexType) {
-                utils.appendExpression(elementName + ".serialize(" + elementXmlRef + ")");
+                utils.appendExpression(elementName + ".serialize(cxfjsutils, " + elementXmlRef
+ ")");
             } else {
+                String typeName = getElementSimpleTypeName(elChild);
                 utils.appendString("<" + elementXmlRef + ">");
                 // warning: this assumes that ordinary Javascript serialization is all we
need.
                 // except for &gt; ad all of that.
-                if (utils.isStringSimpleType((XmlSchemaSimpleType)elType)) {
-                    utils.appendExpression("cxf_xml_serialize_string(" + elementName + ")");
+                if (utils.isStringSimpleType(typeName)) {
+                    utils.appendExpression("cxfjsutils.escapeXmlEntities(" + elementName
+ ")");
                 } else {
                     utils.appendExpression(elementName);
                 }

Added: incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
(added)
+++ incubator/cxf/trunk/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
Mon Oct 29 17:10:38 2007
@@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ 
+ // We use a pseudo-class for name scoping here.
+ 
+function CxfApacheOrgUtil()
+{
+	this.ELEMENT_NODE = 1;
+}
+
+// compensate for Microsoft's weakness here.
+function org_apache_cxf_getNodeLocalName(node)
+{
+    if(node.localName)
+        return node.localName;
+    else
+        return node.baseName;
+}
+
+CxfApacheOrgUtil.prototype.getNodeLocalName = org_apache_cxf_getNodeLocalName; 
+
+
+//*************************************************
+//                     XML Utils
+//*************************************************
+function org_apache_cxf_escapeXmlEntities(val) {
+    if(val == null)
+        return "";
+    else
+        return val.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g,
"&gt;");
+}
+
+CxfApacheOrgUtil.prototype.escapeXmlEntities = org_apache_cxf_escapeXmlEntities; 
+    
+function org_apache_cxf_isElementNil(node) {
+    // we need to look for an attribute xsi:nil, where xsi is
+    // http://www.w3.org/2001/XMLSchema-instance. we have the usual
+    // problem here with namespace-awareness.
+    if ('function' == typeof node.getAttributeNS) {
+        var nillness = node.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
+        return nillness != null && nillness == "true";
+    } else { // we assume the standard prefix and hope for the best.
+        var nillness = node.getAttribute("xsi:nil");
+        return nillness != null && nillness == "true";
+    }
+}
+
+CxfApacheOrgUtil.prototype.isElementNil = org_apache_cxf_isElementNil; 
+
+function org_apache_cxf_getFirstElementChild(node) {
+	var n;
+	for(n = node.firstChild; n != null && n.nodeType !=  this.ELEMENT_NODE; n = n.nextSibling)
{
+	}
+	return n;
+}
+
+CxfApacheOrgUtil.prototype.getFirstElementChild = org_apache_cxf_getFirstElementChild; 
+
+function org_apache_cxf_getNextElementSibling(node) {
+	var n;
+	for(n = node.nextSibling; n != null && n.nodeType != this.ELEMENT_NODE; n = n.nextSibling)
+		;
+	return n;
+}
+
+CxfApacheOrgUtil.prototype.getNextElementSibling = org_apache_cxf_getNextElementSibling;

+
+function org_apache_cxf_isNodeNamedNS(node, namespaceURI, localName)
+{
+    if(namespaceURI == '' || namespaceURI == null) {
+        if(node.namespaceURI == '' || node.namespaceURI == null) {
+            return localName == xml_getLocalName(node);
+        } else
+            return false;
+    } else {
+        return namespaceURI == node.namespaceURI && localName == xml_getLocalName(node);
+    }
+}
+
+CxfApacheOrgUtil.prototype.isNodeNamedNS = org_apache_cxf_isNodeNamedNS; 
+
+//Firefox splits large text regions into multiple Text objects (4096 chars in each).
+function org_apache_cxf_getNodeText(node)
+{
+    var r = "";
+    for(x = 0; x < node.childNodes.length; x ++) {
+        r = r + node.childNodes[x].nodeValue;
+    }
+    return r;
+}
+
+CxfApacheOrgUtil.prototype.getNodeText = org_apache_cxf_getNodeText;

Added: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
(added)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JavascriptTestUtilities.java
Mon Oct 29 17:10:38 2007
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript;
+
+import java.io.IOException;
+import java.io.Reader;
+import org.apache.cxf.test.TestUtilities;
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Function;
+import org.mozilla.javascript.ScriptableObject;
+
+/**
+ * Test utilities class with some Javascript capability included. 
+ */
+public class JavascriptTestUtilities extends TestUtilities {
+    
+    private ScriptableObject rhinoScope;
+    private Context rhinoContext;
+
+    public JavascriptTestUtilities(Class<?> classpathReference) {
+        super(classpathReference);
+    }
+    
+    public void initializeRhino() {
+        rhinoContext = Context.enter();
+        rhinoScope = rhinoContext.initStandardObjects();
+    }
+    
+    public void readResourceIntoRhino(String resourceClasspath) throws IOException {
+        Reader js = getResourceAsReader(resourceClasspath);
+        rhinoContext.evaluateReader(rhinoScope, js, resourceClasspath, 1, null);
+    }
+    
+    public void readStringIntoRhino(String js, String sourceName) {
+        rhinoContext.evaluateString(rhinoScope, js, sourceName, 1, null);
+    }
+    
+    public ScriptableObject getRhinoScope() {
+        return rhinoScope;
+    }
+
+    public Context getRhinoContext() {
+        return rhinoContext;
+    }
+    
+    public Object rhinoEvaluate(String jsExpression) {
+        return rhinoContext.evaluateString(rhinoScope, jsExpression, "<testcase>",
1, null);
+    }
+    
+    public Object rhinoCall(String functionName, Object ... args) {
+        Object fObj = rhinoScope.get(functionName, rhinoScope);
+        if (!(fObj instanceof Function)) {
+            throw new RuntimeException("Missing test function " + functionName);
+        }
+        Function function = (Function)fObj;
+        return function.call(rhinoContext, rhinoScope, rhinoScope, args);
+    }
+
+}

Added: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedUnqualified.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedUnqualified.java?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedUnqualified.java
(added)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/SimpleDocLitWrappedUnqualified.java
Mon Oct 29 17:10:38 2007
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ * 
+ */
+@WebService(targetNamespace = "uri:org.apache.cxf.javascript.fortest")
+public interface SimpleDocLitWrappedUnqualified {
+    String basicTypeFunctionReturnString(@WebParam(name = "s") String s, 
+                                         @WebParam(name = "i") int i, 
+                                         @WebParam(name = "l") long l, 
+                                         @WebParam(name = "f") float f, 
+                                         @WebParam(name = "d") double d);
+    int basicTypeFunctionReturnInt(@WebParam(name = "s") String s, 
+                                   @WebParam(name = "i") int i, 
+                                   @WebParam(name = "l") long l, 
+                                   @WebParam(name = "f") float f, 
+                                   @WebParam(name = "d") double d);
+    void beanFunction(@WebParam(name = "bean1") TestBean1 bean, 
+                      @WebParam(name = "beanArray") TestBean1[] beans);
+}

Added: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
(added)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
Mon Oct 29 17:10:38 2007
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Bean with a selection of elements suitable for testing the JavaScript client.
+ */
+@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
+public class TestBean1 {
+    //CHECKSTYLE:OFF
+    public String stringItem;
+    public int intItem;
+    public long longItem;
+    public byte[] base64Item;
+    @XmlElement(required = false)
+    public int optionalIntItem;
+    @XmlElement(required = false)
+    public int[] optionalIntArrayItem;
+    
+    //CHECKSTYLE:ON
+}

Added: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/package-info.html
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/package-info.html?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/package-info.html
(added)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/package-info.html
Mon Oct 29 17:10:38 2007
@@ -0,0 +1,9 @@
+<html>
+<body>
+<p>
+To refine the JavaScript code, we need some relatively compact schemata that cover the edge
cases.
+None of the testutils services quite do the job. It is possible that the content in here
could
+be refactored with testutils.
+</p>
+</body>
+</html>
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTests.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTests.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTests.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/types/SerializationTests.java
Mon Oct 29 17:10:38 2007
@@ -19,27 +19,42 @@
 
 package org.apache.cxf.javascript.types;
 
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.StringReader;
 import java.util.Collection;
 import java.util.List;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.validation.Schema;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.databinding.DataReader;
+import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.javascript.BasicNameManager;
+import org.apache.cxf.javascript.JavascriptTestUtilities;
 import org.apache.cxf.javascript.NameManager;
-import org.apache.cxf.service.Service;
+import org.apache.cxf.javascript.fortest.TestBean1;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.wsdl.EndpointReferenceUtils;
+import org.junit.Assert;
 import org.junit.Test;
+import org.mozilla.javascript.RhinoException;
 import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
 
 public class SerializationTests extends AbstractDependencyInjectionSpringContextTests {
-    private TestUtilities testUtilities;
+    private JavascriptTestUtilities testUtilities;
+    private XMLInputFactory xmlInputFactory;
 
     public SerializationTests() {
-        testUtilities = new TestUtilities(getClass());
+        testUtilities = new JavascriptTestUtilities(getClass());
+        testUtilities.addDefaultNamespaces();
+        xmlInputFactory = XMLInputFactory.newInstance();
     }
 
     @Override
@@ -50,11 +65,15 @@
     @Test
     public void testSerialization() throws Exception {
         testUtilities.setBus((Bus)applicationContext.getBean("cxf"));
-        testUtilities.addDefaultNamespaces();
-        Server server = testUtilities.getServerForService(new QName("http://apache.org/type_test/doc",

-                                                                "TypeTestPortTypeService"));
-        Service service = server.getEndpoint().getService();
-        List<ServiceInfo> serviceInfos = service.getServiceInfos();
+        
+        testUtilities.initializeRhino();
+        testUtilities.readResourceIntoRhino("/org/apache/cxf/javascript/cxf-utils.js");
+
+        JaxWsProxyFactoryBean clientProxyFactory = 
+            (JaxWsProxyFactoryBean)applicationContext.getBean("simple-dlwu-proxy-factory");
+        
+        Client client = clientProxyFactory.getClientFactoryBean().create();
+        List<ServiceInfo> serviceInfos = client.getEndpoint().getService().getServiceInfos();
         // there can only be one.
         assertEquals(1, serviceInfos.size());
         ServiceInfo serviceInfo = serviceInfos.get(0);
@@ -62,12 +81,47 @@
         NameManager nameManager = new BasicNameManager(serviceInfo);
 
         for (SchemaInfo schema : schemata) {
-            SchemaJavascriptBuilder builder = new SchemaJavascriptBuilder(nameManager, schema);
+            SchemaJavascriptBuilder builder = 
+                new SchemaJavascriptBuilder(nameManager, schema);
             String allThatJavascript = builder.generateCodeForSchema(schema);
             assertNotNull(allThatJavascript);
+            testUtilities.readStringIntoRhino(allThatJavascript, schema.toString());
+        }
+        
+        testUtilities.readResourceIntoRhino("/serializationTest.js");
+        DataBinding dataBinding = clientProxyFactory.getServiceFactory().getDataBinding();
+        assertNotNull(dataBinding);
+        
+        try {
+            Object serialized = testUtilities.rhinoCall("serializeTestBean1_1");
+            assertTrue(serialized instanceof String);
+            String xml = (String)serialized;
+            DataReader<XMLStreamReader> reader = dataBinding.createReader(XMLStreamReader.class);
+            StringReader stringReader = new StringReader(xml);
+            XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(stringReader);
+            QName testBeanQName = new QName("uri:org.apache.cxf.javascript.testns", "TestBean1");
+            Object bean = reader.read(testBeanQName, xmlStreamReader, TestBean1.class);
+            assertNotNull(bean);
+            assertTrue(bean instanceof TestBean1);
+            TestBean1 testBean = (TestBean1)bean;
+            assertEquals("bean1<stringItem", testBean.stringItem);
+            assertEquals(64, testBean.intItem);
+            assertEquals(64000000, testBean.longItem);
+            assertEquals(101, testBean.optionalIntItem);
+            assertNotNull(testBean.optionalIntArrayItem);
+            assertEquals(1, testBean.optionalIntArrayItem.length);
+            assertEquals(543, testBean.optionalIntArrayItem[0]);
+            
+        } catch (RhinoException angryRhino) {
+            String trace = angryRhino.getScriptStackTrace(new FilenameFilter() {
+
+                public boolean accept(File dir, String name) {
+                    return true;
+                }
+            } 
+            );
+            Assert.fail("Javascript error: " + angryRhino.toString() + " " + trace);
         }
+        
     }
-    
-    
-    
 }

Added: incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTest.js
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTest.js?rev=589916&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTest.js (added)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTest.js Mon Oct 29 17:10:38
2007
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ 
+ var jsutils = new CxfApacheOrgUtil();
+ 
+ function serializeTestBean1_1()
+ {
+ 	var bean1 = new org_apache_cxf_javascript_testns_testBean1();
+ 	bean1.setStringItem("bean1<stringItem");
+ 	bean1.setIntItem(64);
+ 	bean1.setLongItem(64000000);
+ 	bean1.setBase64Item(''); // later
+ 	bean1.setOptionalIntItem(101);
+ 	var a = [];
+ 	a.push(543);
+ 	bean1.setOptionalIntArrayItem(a);
+	return bean1.serialize(jsutils, "testBean1");
+} 
+
+ function serializeTestBean1_2()
+ {
+ 	var bean1 = new org_apache_cxf_javascript_testns_testBean1();
+ 	bean1.setStringItem("bean1<stringItem");
+ 	bean1.setIntItem(64);
+ 	bean1.setLongItem(64000000);
+ 	bean1.setBase64Item(''); // later
+ 	bean1.setOptionalIntItem(null);
+ 	var a = [];
+ 	a.push(543);
+ 	a.push(null);
+ 	a.push(345);
+ 	bean1.setOptionalIntArrayItem(a);
+	return bean1.serialize(jsutils, "testBean1");
+}
+
+ function serializeTestBean1_3()
+ {
+ 	var bean1 = new org_apache_cxf_javascript_testns_testBean1();
+ 	bean1.setStringItem("bean1<stringItem");
+ 	bean1.setIntItem(64);
+ 	bean1.setLongItem(64000000);
+ 	bean1.setBase64Item(''); // later
+ 	bean1.setOptionalIntItem(33);
+ 	bean1.setOptionalIntArrayItem(null);
+	return bean1.serialize(jsutils, "testBean1");
+} 

Modified: incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTestBeans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTestBeans.xml?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTestBeans.xml (original)
+++ incubator/cxf/trunk/rt/javascript/src/test/resources/serializationTestBeans.xml Mon Oct
29 17:10:38 2007
@@ -30,11 +30,22 @@
 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml" />
 	<import resource="classpath:META-INF/cxf/cxf-extension-local.xml" />
-
+	
+	<!--  We use a client for the service for basic tests. We don't need a server at all.
-->
+	<bean id="simple-dlwu-proxy-factory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"
>
+    <property name="serviceClass" value="org.apache.cxf.javascript.fortest.SimpleDocLitWrappedUnqualified"/>
+    <property name="address" value="local://SimpleDocLitWrappedUnqualified"/>
+  </bean>
+   
+  <bean id="simple-dlwu-client" class="org.apache.cxf.javascript.fortest.SimpleDocLitWrappedUnqualified"
scope='prototype'
+    factory-bean="simple-dlwu-proxy-factory" factory-method="create"/>
+	
 	<!-- Services. We use the JAXB test server which handles a lot of types. -->
+	<!--  very slow to set up, and not obviously useful
 	<jaxws:server id="TestServer" 
                    serviceClass="org.apache.type_test.doc.TypeTestPortType" 
 	               address="local://TestService">
 	</jaxws:server>
+	-->
 </beans>
 

Modified: incubator/cxf/trunk/systests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/pom.xml?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/systests/pom.xml (original)
+++ incubator/cxf/trunk/systests/pom.xml Mon Oct 29 17:10:38 2007
@@ -384,7 +384,7 @@
         <dependency>
             <groupId>rhino</groupId>
             <artifactId>js</artifactId>
-            <version>1.6R5</version>
+            <version>1.6R6</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaClass.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaClass.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaClass.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaClass.java
Mon Oct 29 17:10:38 2007
@@ -22,7 +22,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.cxf.tools.util.AnnotationUtil;
+import org.apache.cxf.common.util.StringUtils;
 
 public class JavaClass extends JavaInterface {
     
@@ -44,7 +44,7 @@
     }
 
     public JavaMethod appendGetter(JavaField field) {
-        String getterName = "get" + AnnotationUtil.capitalize(field.getName());
+        String getterName = "get" + StringUtils.capitalize(field.getName());
         JavaMethod jMethod = new JavaMethod(this);
         jMethod.setName(getterName);
         jMethod.setReturn(new JavaReturn(field.getName(),
@@ -63,7 +63,7 @@
     }
 
     public JavaMethod appendSetter(JavaField field) {
-        String setterName = "set" + AnnotationUtil.capitalize(field.getName());
+        String setterName = "set" + StringUtils.capitalize(field.getName());
         JavaMethod jMethod = new JavaMethod(this);
         jMethod.setReturn(new JavaReturn("return", "void", null));
         String paramName = getSetterParamName(field.getName());
@@ -83,7 +83,7 @@
     }
 
     private String getSetterParamName(String fieldName) {
-        return "new" + AnnotationUtil.capitalize(fieldName);
+        return "new" + StringUtils.capitalize(fieldName);
     }
     
 }

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
Mon Oct 29 17:10:38 2007
@@ -98,15 +98,6 @@
         return classpath.toString();
     }
 
-    public static String capitalize(String name) {
-        if (name == null || name.length() == 0) {
-            return name;
-        }
-        char chars[] = name.toCharArray();
-        chars[0] = Character.toUpperCase(chars[0]);
-        return new String(chars);
-    }
-
     public static WebParam getWebParam(Method method, String paraName) {
 
         Annotation[][] anno = getPrivParameterAnnotations(method);

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/RequestWrapper.java
Mon Oct 29 17:10:38 2007
@@ -29,7 +29,6 @@
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
-import org.apache.cxf.tools.util.AnnotationUtil;
 
 public class RequestWrapper extends Wrapper {
     @Override
@@ -97,7 +96,7 @@
             reqNs = reqWrapper.targetNamespace().length() > 0 ? reqWrapper.targetNamespace()
: null;
         } 
         if (reqClassName == null) {
-            reqClassName = getPackageName(method) + ".jaxws." + AnnotationUtil.capitalize(method.getName());
+            reqClassName = getPackageName(method) + ".jaxws." + StringUtils.capitalize(method.getName());
         }
 
         WrapperBeanClass jClass = new WrapperBeanClass();

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java?rev=589916&r1=589915&r2=589916&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
Mon Oct 29 17:10:38 2007
@@ -30,8 +30,6 @@
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
-import org.apache.cxf.tools.util.AnnotationUtil;
-
 
 public final class ResponseWrapper extends Wrapper { 
     @Override
@@ -125,7 +123,7 @@
         }  
         if (resClassName == null) {
             resClassName = getPackageName(method) + ".jaxws." 
-                + AnnotationUtil.capitalize(method.getName())
+                + StringUtils.capitalize(method.getName())
                 + "Response";
         }
         



Mime
View raw message