3
votes

I want to post a message to a SOAP webservice with MULE Enterprise edition. For creating the Request object i am using a data mapper with the input a POJO and for the output i selected XML , and from example XML schema i added my own XSD. Because there are a lot of elements in the xsd, i selected the root element from the list provided.

Then i am dragging the fields from input to the corresponding values i want in the output. (i also tried to map just one field, to be sure that i keep the minimum the probability for error).

And now the problem: when the flow is accessed, the following WARN is shown and the data-mapper fails

*[XML WRITER:EXT_XML_WRITER0] - Invalid mapping (With port binded to root element, result might contain multiple root elements. Such XML is not well-formed. To avoid that, set 'Records per file' or 'Max number of records' component attribute to '1'.)*

Where can i set this kind of options in the data mapper ?

And also i want the root element to be only one, i don't need a foreach for the root element, i just need to fill the contents of it. Can i specify this anywhere in the data mapper ?

Thanks.

2

2 Answers

5
votes

Mule EE DataMapper uses CloverETL for data transformations, and this annoying warning concerns CloverETL settings. I don't know if you can advise CloverETL to use a specific configuration file in the context of Mule DataMapper, but you can always edit the mapping file generated by Mule with a text editor. Just find your root Node entry in the mapping file and add recordsPerFile="1" attribute. The problem with this is that Mule may overwrite your manual edits if you use the graphical editor, though.

0
votes

Check out the Anypoint Studio May 2014. Mule now includes a new Web Service Connector for posting messages to a SOAP web service using just a WSDL. Studio will read the XML Schema from the WSDL and automatically create the metadata for DataMapper for you. See http://www.mulesoft.org/documentation/display/current/Web+Service+Consumer for more details.