Mapping step issue when publishing a list structure that has

CONTEXT:
The document that is published to the broker contains a list of strings, which is checked against the structure when publishing the document.
webMethods 6.0.1 is used.

PROBLEM:
During a mapping step, when the list of strings does include only one occurence, then the associated structure is transformed into a string, instead of a list string that contains one occurence. This raises an error when publishing the document to the broker.

WORKARROUND:
As a workarround, the flow is checking the number of entries within the input and additional mapping step can enforce the list structure in case of a single entry. There must be an easier solution: could someone provide a useful tip ?

Alexandre,

I think we need a bit more info on how you are creating the string/string list in the first place. A rule of thumb in cases like this is to ensure that the initial mapping to an object enforces it to be a string list [and never just a string].

You can use services like appendToStringList in WmPublic/list to help you out in this case. So, as you map your data to the intermediate structure, always use appendToStringList. This way, even if you only have one string, it will be a string list.

If this doesn’t help, if you have any more details of the early steps of your mapping [ie. what structure is the data, how you map it now etc] send it across.

James…

Hi James.
Thank you for your answer.
You were right, the problem was due to the initial mapping step.