From 22b5f69839c30ca5f949fa7c4f06623680532d80 Mon Sep 17 00:00:00 2001 From: malakaganga Date: Sun, 10 Nov 2024 10:21:47 +0530 Subject: [PATCH] Add missing attribute escapeNonPrintableChar in DS Fixes: https://github.com/wso2/product-micro-integrator/issues/3686 --- .../core/DataServiceDocLitWrappedSchemaGenerator.java | 1 + .../dataservices/core/description/query/QuerySerializer.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/DataServiceDocLitWrappedSchemaGenerator.java b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/DataServiceDocLitWrappedSchemaGenerator.java index 6c852c061c..0cc5f2cf48 100644 --- a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/DataServiceDocLitWrappedSchemaGenerator.java +++ b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/DataServiceDocLitWrappedSchemaGenerator.java @@ -445,6 +445,7 @@ private static void processCallQuery(CommonParams cparams, XmlSchemaElement pare activeElement.setMinOccurs(0); activeElement.setMaxOccurs(Long.MAX_VALUE); } + /* process the result content */ processElementGroup(cparams, activeElement, result.getDefaultElementGroup()); } diff --git a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/description/query/QuerySerializer.java b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/description/query/QuerySerializer.java index 12c832e6fb..bead526d07 100644 --- a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/description/query/QuerySerializer.java +++ b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/description/query/QuerySerializer.java @@ -198,6 +198,10 @@ private static void serializeResult(Result result, OMElement queryEl, OMFactory if (elementName != null) { resEl.addAttribute(DBSFields.ELEMENT, elementName, null); } + String escapeNonPrintableChar = String.valueOf(result.isEscapeNonPrintableChar()); + if (!escapeNonPrintableChar.isEmpty()) { + resEl.addAttribute(DBSFields.ESCAPE_NON_PRINTABLE_CHAR, escapeNonPrintableChar, null); + } String rowName = result.getRowName(); if (rowName != null) { resEl.addAttribute(DBSFields.ROW_NAME, rowName, null);