Hi Team,
I'd like to submit a feature request regarding pub.xml:documentToXMLString in webMethods Integration Server.
Currently, pub.xml:documentToXMLString generates empty XML tags (e.g., <MessageName/> or <MessageName></MessageName>) when a field in the input document has a null or empty string value (""). This behavior occurs because when a flow service MAP step creates a link between a source and target variable, Integration Server assigns an empty string ("") to the target field even if the source value is null. As a result, documentToXMLString treats the field as existing and generates an empty tag.
While this behavior is valid from an XML specification standpoint, it causes significant issues in B2B/EDI integration scenarios, particularly during migrations from other integration platforms, where trading partners expect that fields with no value are simply omitted from the XML output rather than represented as empty tags.
The existing parameters generateRequiredTags and generateNilTags do not address this use case:
-. generateRequiredTags controls whether mandatory fields missing from the document are included.
-. generateNilTags adds xsi:nil="true" to null fields (requires generateRequiredTags=true and documentTypeName).
Neither option suppresses the generation of empty tags for null or empty string fields.
The server configuration parameter watt.server.service.list.treatEmptyAsNull addresses only Document List / String List types and does not resolve the issue for String type fields.
[Requested Enhancement]
Add a new input parameter to pub.xml:documentToXMLString:
suppressEmptyTags (String, Optional)
-. true: Suppresses XML tag generation for fields whose value is null or empty string ("").
-. false: Current default behavior (empty tags are generated).
This would allow developers to control tag generation behavior without requiring custom Java Services or per-field Copy Conditions as workarounds.
[Business Impact]
This is a common pain point in B2B/EDI migration projects. EDI standards (EDIFACT, X12, etc.) and many XML-based B2B interfaces follow the convention of omitting fields with no value entirely. When migrating from other integration platforms that follow this convention to webMethods Integration Server, trading partners receive unexpected empty XML tags, resulting in complaints and potentially failed message processing on the receiving side.
A simple parameter on documentToXMLString would eliminate the need for workarounds and significantly reduce implementation effort in migration scenarios.
Thank you for considering this request.
Best regards,
Sunjin Yim