You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Juergen Kellerer (JIRA)" <ji...@apache.org> on 2009/03/29 17:29:50 UTC

[jira] Created: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Deserializer for complex types is not created inside the generated JavaScript client code
-----------------------------------------------------------------------------------------

                 Key: CXF-2139
                 URL: https://issues.apache.org/jira/browse/CXF-2139
             Project: CXF
          Issue Type: Bug
          Components: JavaScript Client
    Affects Versions: 2.2, 2.1.4
         Environment: Java 1.6, ANT based build script
            Reporter: Juergen Kellerer


The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.

Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
----
    public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
        utils = new JavascriptUtils(code);
        XmlSchemaSequence sequence = null;

        sequence = XmlSchemaUtils.getSequence(type);

        // HACK, use alternate way to get sequence
        if (sequence.getItems().getCount() == 0) {
                XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
                if (s != null) {
                        System.err.println("HACK-applied, generating deserializer for " + name);
                        sequence = s;
                }
        }
        // HACK-END, use alternate way to get sequence

        String typeObjectName = nameManager.getJavascriptName(name);
---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Kellerer updated CXF-2139:
----------------------------------

    Attachment: SchemaJavascriptBuilder.diff

Here you go. (Please ignore changed imports, I ran reformat code.. my bad.)

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>         Attachments: js-patch-2.1.4.jar, SchemaJavascriptBuilder.diff
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693571#action_12693571 ] 

Juergen Kellerer edited comment on CXF-2139 at 3/29/09 8:49 AM:
----------------------------------------------------------------

.. was a bit to fast with the given HACK, simply using the method from the serializer code seems the fix the problem better, the solution I used before doesn't cover inheritance. However I'm still not sure if this causes any other side effects, it's just a quick HACK that does the trick for me.

public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
       utils = new JavascriptUtils(code);
       List<XmlSchemaObject> items = XmlSchemaUtils.getContentElements(type, xmlSchemaCollection);

       String typeObjectName = nameManager.getJavascriptName(name);
       code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
       // create the object we are deserializing into.
       utils.appendLine("var newobject = new " + typeObjectName + "();");
       utils.appendLine("cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));");
       utils.appendLine("var curElement = cxfjsutils.getFirstElementChild(element);");

       utils.appendLine("var item;");

       for (ListIterator<XmlSchemaObject> i = items.listIterator(); i.hasNext();) {
              utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
              XmlSchemaObject thing = i.next();
              ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, schemaInfo.getSchema(),
                            xmlSchemaCollection, prefixAccumulator, type.getQName());
              if (itemInfo.isAny()) {
                     ParticleInfo nextItem = null;
                     if (i.hasNext()) {
                            XmlSchemaObject nextThing = i.next();
                            nextItem = ParticleInfo.forLocalItem(nextThing, schemaInfo.getSchema(),
                                          xmlSchemaCollection, prefixAccumulator, type.getQName());
                            // theoretically, you could have two anys with different
                            // namespaces.
                            if (nextItem.isAny()) {
                                      unsupportedConstruct("MULTIPLE_ANY", type.getQName());
                            }
                     }
                     deserializeAny(type, itemInfo, nextItem);
              } else {
                     deserializeElement(type, thing);
              }
       }
       utils.appendLine("return newobject;");
       code.append("}\n\n");
}

      was (Author: juergenk):
    .. was a bit to fast with the given HACK, simply using the method from the serializer code seems the fix the problem better, the solution I used before doesn't cover inheritance. However I'm still not sure if this causes any other side effects, it's just a quick HACK that does the trick for me.

public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
       utils = new JavascriptUtils(code);
       List<XmlSchemaObject> items = XmlSchemaUtils.getContentElements(type, xmlSchemaCollection);

       String typeObjectName = nameManager.getJavascriptName(name);
       code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
       // create the object we are deserializing into.
       utils.appendLine("var newobject = new " + typeObjectName + "();");
       utils.appendLine("cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));");
		utils.appendLine("var curElement = cxfjsutils.getFirstElementChild(element);");

       utils.appendLine("var item;");

       for (ListIterator<XmlSchemaObject> i = items.listIterator(); i.hasNext();) {
              utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
              XmlSchemaObject thing = i.next();
              ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, schemaInfo.getSchema(),
                            xmlSchemaCollection, prefixAccumulator, type.getQName());
              if (itemInfo.isAny()) {
                     ParticleInfo nextItem = null;
                     if (i.hasNext()) {
                            XmlSchemaObject nextThing = i.next();
                            nextItem = ParticleInfo.forLocalItem(nextThing, schemaInfo.getSchema(),
                                          xmlSchemaCollection, prefixAccumulator, type.getQName());
                            // theoretically, you could have two anys with different
                            // namespaces.
                            if (nextItem.isAny()) {
                                      unsupportedConstruct("MULTIPLE_ANY", type.getQName());
                            }
                     }
                     deserializeAny(type, itemInfo, nextItem);
              } else {
                     deserializeElement(type, thing);
              }
       }
utils.appendLine("return newobject;");
code.append("}\n\n");
}
  
> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693736#action_12693736 ] 

Juergen Kellerer edited comment on CXF-2139 at 3/30/09 4:51 AM:
----------------------------------------------------------------

Here you go. (Please ignore changed imports, I ran reformat code.. my bad.)
---
I have to add that this was made for version 2.1.4, I just quickly tried 2.2 and saw it has the same issue.

      was (Author: juergenk):
    Here you go. (Please ignore changed imports, I ran reformat code.. my bad.)
  
> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>         Attachments: js-patch-2.1.4.jar, SchemaJavascriptBuilder.diff
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693571#action_12693571 ] 

Juergen Kellerer commented on CXF-2139:
---------------------------------------

.. was a bit to fast with the given HACK, simply using the method from the serializer code seems the fix the problem better, the solution I used before doesn't cover inheritance. However I'm still not sure if this causes any other side effects, it's just a quick HACK that does the trick for me.

	public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
		utils = new JavascriptUtils(code);
		List<XmlSchemaObject> items = XmlSchemaUtils.getContentElements(type, xmlSchemaCollection);

		String typeObjectName = nameManager.getJavascriptName(name);
		code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
		// create the object we are deserializing into.
		utils.appendLine("var newobject = new " + typeObjectName + "();");
		utils.appendLine("cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));");
		utils.appendLine("var curElement = cxfjsutils.getFirstElementChild(element);");

		utils.appendLine("var item;");

		for (ListIterator<XmlSchemaObject> i = items.listIterator(); i.hasNext();) {
			utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
			XmlSchemaObject thing = i.next();
			ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, schemaInfo.getSchema(),
					xmlSchemaCollection, prefixAccumulator, type.getQName());
			if (itemInfo.isAny()) {
				ParticleInfo nextItem = null;
				if (i.hasNext()) {
					XmlSchemaObject nextThing = i.next();
					nextItem = ParticleInfo.forLocalItem(nextThing, schemaInfo.getSchema(),
							xmlSchemaCollection, prefixAccumulator, type.getQName());
					// theoretically, you could have two anys with different
					// namespaces.
					if (nextItem.isAny()) {
						unsupportedConstruct("MULTIPLE_ANY", type.getQName());
					}
				}
				deserializeAny(type, itemInfo, nextItem);
			} else {
				deserializeElement(type, thing);
			}
		}
		utils.appendLine("return newobject;");
		code.append("}\n\n");
	}



> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693625#action_12693625 ] 

Benson Margulies commented on CXF-2139:
---------------------------------------

Hi there. For legal reasons, I have to ask you to post a diff with the 'licensed to Apache' flag turned on for me to work with this.


> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>         Attachments: js-patch-2.1.4.jar
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693571#action_12693571 ] 

Juergen Kellerer edited comment on CXF-2139 at 3/29/09 8:48 AM:
----------------------------------------------------------------

.. was a bit to fast with the given HACK, simply using the method from the serializer code seems the fix the problem better, the solution I used before doesn't cover inheritance. However I'm still not sure if this causes any other side effects, it's just a quick HACK that does the trick for me.

public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
       utils = new JavascriptUtils(code);
       List<XmlSchemaObject> items = XmlSchemaUtils.getContentElements(type, xmlSchemaCollection);

       String typeObjectName = nameManager.getJavascriptName(name);
       code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
       // create the object we are deserializing into.
       utils.appendLine("var newobject = new " + typeObjectName + "();");
       utils.appendLine("cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));");
		utils.appendLine("var curElement = cxfjsutils.getFirstElementChild(element);");

       utils.appendLine("var item;");

       for (ListIterator<XmlSchemaObject> i = items.listIterator(); i.hasNext();) {
              utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
              XmlSchemaObject thing = i.next();
              ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, schemaInfo.getSchema(),
                            xmlSchemaCollection, prefixAccumulator, type.getQName());
              if (itemInfo.isAny()) {
                     ParticleInfo nextItem = null;
                     if (i.hasNext()) {
                            XmlSchemaObject nextThing = i.next();
                            nextItem = ParticleInfo.forLocalItem(nextThing, schemaInfo.getSchema(),
                                          xmlSchemaCollection, prefixAccumulator, type.getQName());
                            // theoretically, you could have two anys with different
                            // namespaces.
                            if (nextItem.isAny()) {
                                      unsupportedConstruct("MULTIPLE_ANY", type.getQName());
                            }
                     }
                     deserializeAny(type, itemInfo, nextItem);
              } else {
                     deserializeElement(type, thing);
              }
       }
utils.appendLine("return newobject;");
code.append("}\n\n");
}

      was (Author: juergenk):
    .. was a bit to fast with the given HACK, simply using the method from the serializer code seems the fix the problem better, the solution I used before doesn't cover inheritance. However I'm still not sure if this causes any other side effects, it's just a quick HACK that does the trick for me.

	public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
		utils = new JavascriptUtils(code);
		List<XmlSchemaObject> items = XmlSchemaUtils.getContentElements(type, xmlSchemaCollection);

		String typeObjectName = nameManager.getJavascriptName(name);
		code.append("function " + typeObjectName + "_deserialize (cxfjsutils, element) {\n");
		// create the object we are deserializing into.
		utils.appendLine("var newobject = new " + typeObjectName + "();");
		utils.appendLine("cxfjsutils.trace('element: ' + cxfjsutils.traceElementName(element));");
		utils.appendLine("var curElement = cxfjsutils.getFirstElementChild(element);");

		utils.appendLine("var item;");

		for (ListIterator<XmlSchemaObject> i = items.listIterator(); i.hasNext();) {
			utils.appendLine("cxfjsutils.trace('curElement: ' + cxfjsutils.traceElementName(curElement));");
			XmlSchemaObject thing = i.next();
			ParticleInfo itemInfo = ParticleInfo.forLocalItem(thing, schemaInfo.getSchema(),
					xmlSchemaCollection, prefixAccumulator, type.getQName());
			if (itemInfo.isAny()) {
				ParticleInfo nextItem = null;
				if (i.hasNext()) {
					XmlSchemaObject nextThing = i.next();
					nextItem = ParticleInfo.forLocalItem(nextThing, schemaInfo.getSchema(),
							xmlSchemaCollection, prefixAccumulator, type.getQName());
					// theoretically, you could have two anys with different
					// namespaces.
					if (nextItem.isAny()) {
						unsupportedConstruct("MULTIPLE_ANY", type.getQName());
					}
				}
				deserializeAny(type, itemInfo, nextItem);
			} else {
				deserializeElement(type, thing);
			}
		}
		utils.appendLine("return newobject;");
		code.append("}\n\n");
	}


  
> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-2139:
-----------------------------

    Fix Version/s: 2.1.5

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>             Fix For: 2.1.5, 2.2.1
>
>         Attachments: js-patch-2.1.4.jar, SchemaJavascriptBuilder.diff
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694833#action_12694833 ] 

Benson Margulies commented on CXF-2139:
---------------------------------------

That diff was pretty untractable due to the lack of -u or -c and the reformatting.

What I really need is a testcase of the problem ...

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>         Attachments: js-patch-2.1.4.jar, SchemaJavascriptBuilder.diff
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies resolved CXF-2139.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.1

I committed a fix based on your work. Please try it out.

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>             Fix For: 2.2.1
>
>         Attachments: js-patch-2.1.4.jar, SchemaJavascriptBuilder.diff
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Juergen Kellerer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Kellerer updated CXF-2139:
----------------------------------

    Attachment: js-patch-2.1.4.jar

This is a compiled version of the described HACK to test it quickly.

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>         Attachments: js-patch-2.1.4.jar
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-2139) Deserializer for complex types is not created inside the generated JavaScript client code

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies reassigned CXF-2139:
-------------------------------------

    Assignee: Benson Margulies

> Deserializer for complex types is not created inside the generated JavaScript client code
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-2139
>                 URL: https://issues.apache.org/jira/browse/CXF-2139
>             Project: CXF
>          Issue Type: Bug
>          Components: JavaScript Client
>    Affects Versions: 2.1.4, 2.2
>         Environment: Java 1.6, ANT based build script
>            Reporter: Juergen Kellerer
>            Assignee: Benson Margulies
>         Attachments: js-patch-2.1.4.jar
>
>
> The JavaScript client code generator successfully creates serializers and deserializers for first level soap requests and response objects. Serializing code is also created for complex types but the deserializer code is not created.
> Digging down the code it seems that the problem is in the class "org.apache.cxf.javascript.types.SchemaJavascriptBuilder" the following HACK made the JS client work correctly:
> ----
>     public void domDeserializerFunction(QName name, XmlSchemaComplexType type) {
>         utils = new JavascriptUtils(code);
>         XmlSchemaSequence sequence = null;
>         sequence = XmlSchemaUtils.getSequence(type);
>         // HACK, use alternate way to get sequence
>         if (sequence.getItems().getCount() == 0) {
>                 XmlSchemaSequence s = XmlSchemaUtils.getContentSequence(type);
>                 if (s != null) {
>                         System.err.println("HACK-applied, generating deserializer for " + name);
>                         sequence = s;
>                 }
>         }
>         // HACK-END, use alternate way to get sequence
>         String typeObjectName = nameManager.getJavascriptName(name);
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.