mikeandrews
8 years agoNew Contributor III
Is XML Parser _very_ strict?
Hi folks,
I was looking to expose a Task via URL trigger with a payload of an XML message, so i started mocking this up with a sample XML as a file in SLFS and a simple pipeline File Reader → XML Parser → do-stuff.
I didnt specify the “Inbound schema” on the XML Parser for the incoming binary XML, and even on a very simplified XML structure I’m getting:
Failure: Failed to convert xml to json, Reason: Mixed content is not supported: ’ ', Resolution: Please check if the xml data is well formed
the XML is considered valid by other non-SL tools:
<EnterpriseMessage xmlns="http://schemas.xxxx.com/enterprise/services/2014/05" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<EnterpriseHeader>
<MessageId>1369611c-eb2b-41ca-9573-852125cb418e</MessageId>
<ThreadId>774c8fe4-145d-40c0-bfea-442bb29aa85c</ThreadId>
<CreatedUtc>2016-01-12T14:13:32.654Z</CreatedUtc>
</EnterpriseHeader>
<MessageBody>
<BusinessData xmlns="">
<Label>
<OBJ_VER>0</OBJ_VER>
<xxxx_COMPANY>10448</xxxx_COMPANY>
</Label>
<Company>
<xxxx_COMPANY_ID>10448</xxxx_COMPANY_ID>
<xxxx_COUNTRY_ID>320</xxxx_COUNTRY_ID>
</Company>
</BusinessData>
</MessageBody>
</EnterpriseMessage>
Is it essential to set the schema to assist the parser? Sometimes the namespaces will vary or the schema be dynamic…