Dexels / navajo

Navajo Service-oriented Applications
GNU Affero General Public License v3.0
9 stars 5 forks source link

(Navajo) Strange message structure when referring back to a message with eg "../Test/Test" in a loop #487

Open kharybdys opened 5 years ago

kharybdys commented 5 years ago

Webservice to reproduce:

<?xml version="1.0" encoding="UTF-8"?>
<navascript>

    <!-- In order for this to go "wrong" it is absolutely necessary both messages have the same name -->
    <message name="Test" type="simple">
        <message name="Test" type="array"/>
    </message>

    <map object="com.dexels.navajo.adapter.TokenizerMap">
        <field name="delimiter">
            <expression value="';'"/>
        </field>
        <field name="value">
            <expression value="'AAP#MARTE;NOOT#CARLO;MIES#MARTIN'"/>
        </field>
        <message name="Process" mode="ignore">
            <map ref="tokens">
                <map object="com.dexels.navajo.adapter.TokenizerMap">
                    <field name="delimiter">
                        <expression value="'#'"/>
                    </field>
                    <field name="value">
                        <expression value="$../value"/>
                    </field>

                    <message name="../Test/Test">
                        <map ref="tokens">
                            <property name="Token">
                                <expression value="$value"/>
                            </property>
                        </map>
                    </message>
                </map>
            </map>
        </message>
    </map>
</navascript>
kharybdys commented 5 years ago

Generated output is:

<message name="Test">
      <message name="Test" type="array">
         <message name="Test" index="0" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="AAP" direction=""/>
            </message>
         </message>
         <message name="Test" index="1" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="MARTE" direction=""/>
            </message>
         </message>
         <message name="Test" index="2" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="NOOT" direction=""/>
            </message>
         </message>
         <message name="Test" index="3" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="CARLO" direction=""/>
            </message>
         </message>
         <message name="Test" index="4" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="MIES" direction=""/>
            </message>
         </message>
         <message name="Test" index="5" type="array_element">
            <message name="Test">
               <property name="Token" type="string" value="MARTIN" direction=""/>
            </message>
         </message>
      </message>
   </message>

It seems to have created one layer of Test message too many.

I was unable to reproduce if the simple message and array message had different names