Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2139

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.4, 2.2
    • 2.1.5, 2.2.1
    • JavaScript Client
    • None
    • Java 1.6, ANT based build script

    • Moderate

    Description

      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);

      Attachments

        1. SchemaJavascriptBuilder.diff
          4 kB
          Juergen Kellerer
        2. js-patch-2.1.4.jar
          7 kB
          Juergen Kellerer

        Activity

          People

            bmargulies Benson Margulies
            juergenk Juergen Kellerer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: