Four Stars

tXMLMap Component and Web Service Parameter that is an Array of Strings

I am using the tXMLMap component to format data for a tESBConsumer component (using Talend Data Integration 6.4.1) to talk to a SOAP Web Service. We need to use a Web Service method that requires one of its parameters to be an array of strings, such that the payload needs to become something like:

"...   <simpleParam>Simple Param Value</simpleParam><arrayOfStringsParam><string>Array Item 1</string><string>Array Item 2</string><string>Array Item 3</string></arrayOfStringsParam> ..."

 

I cannot determine how to pass the array into the control to get it in the correct format. There is no type for Schema fields of String[].

  

There is already a loop element in the tXMLMap, used for each input record, so I cannot use the looping mechanism.

 

I tried a type List but it got written out in the payload as something like "... <arrayOfStringsParam>[Array Item 1, Array Item 2,Array Item 3]</arrayOfStringsParam> ...".

 

I tried a type of String and formatted the data in previous steps as  "<string>Array Item 1</string><string>Array Item 2</string><string>Array Item 3</string>" but in the resulting payload the less-than (<) signs got encoded to "&lt;" so they weren't recognised as proper tags.

 

Can someone please let me know how to get this data in the appropriate format.

 

Thanks in anticipation,

Alan

 

Tags (1)