Value element cannot be used as key or argument, because it appears after object elements in the XML

4
Can anyone help me with this errormessage? I think it has something to do with the fact that there are objects 'in the middle' of the root object
asked
2 answers
8

I've seen this error too. In my case I had an XML document like this:

<root-entity>
   <root-entity-attribute-1>...</root-entity-attribute-1>
   <sub-entity>
      <sub-entity-attribute-1>...</sub-entity-attribute-1>
      <sub-entity-attribute-2>...</sub-entity-attribute-2>
   </sub-entity>
   <root-entity-attribute-2>...</root-entity-attribute-2>
</root-entity>

The errors occurs when in the XML mapping you use an object handler microflow for <root-entity> where you pass <root-entity-attribute-2> as the input parameter, because it appears after the sub-entity in the XML document. Changing the XML to the following will fix the error:

<root-entity>
   <root-entity-attribute-1>...</root-entity-attribute-1>
   <root-entity-attribute-2>...</root-entity-attribute-2>
   <sub-entity>
      <sub-entity-attribute-1>...</sub-entity-attribute-1>
      <sub-entity-attribute-2>...</sub-entity-attribute-2>
   </sub-entity>
</root-entity>

In my case this change was no problem (in fact, the second format was "better" for our use-case anyway), so I didn't file a bug report, but it is a bit weird that the order in the XML matters at all (I'm guessing this is a result of using a streaming XML parser).

answered
1

Thanks Alexander, we have the exact same case. I think that the wsdl we are using can not be changed that easy;

@ Achiel: is it something we could change with some adjustments or is it simply not possible given the fact the we use streaming?

answered