Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Workbench WebService Invocation: Returning response as CDATA


Not applicable
Hello,<br /><br />I am trying to invoke a webservice from LiveCycle Workbench. I was able to invoke the service successfully. The service returns an XML-string, so the response is coming as CDATA content. <br /><br />I am unable to extract the CDATA content from the web-service response: Here is my service response:<br /><p><br /><soap:Envelope xmlns:soap="" xmlns:xsd="" xmlns:xsi=""><br /> <soap:Body><br /> <ns1:getXMLExtractForAClaimResponse xmlns:ns1=""><br /> <ns1:out><br /><?xml version="1.0" encoding="UTF-8"?><EamsClaim><br />...................<br /></EamsClaim></ns1:out><br /> </ns1:getXMLExtractForAClaimResponse><br /> </soap:Body><br /></soap:Envelope><br /></p><br />I am struck over here. Please help me in resolving this. I created a variable "cdataList" of type List containing objects of type "document", and then I tried to get the webservice response as that list. After invocation of my service, the cdataList element is empty. <br /><br />Thanks in advance<br />Sivajee.
3 Replies


Level 10
I don't see any CData in there.



Not applicable
Here is the msg... Somehow its not getting the entire data which I posted... Even though I am putting the code, the CDATA element after <ns1:out> is not getting displayed<br /><code><br />soap:Envelope xmlns:soap="" xmlns:xsd="" xmlns:xsi=""><br /> <soap:Body><br /> <ns1:getXMLExtractForAClaimResponse xmlns:ns1=""><br /> <ns1:out> XML STRING<br /><br /></ns1:out><br /> </ns1:getXMLExtractForAClaimResponse><br /> </soap:Body><br /></soap:Envelope><br /></code>


Level 10
Ok, then what you'll need to do is something like this:<br /><br />1- Get the data from the <ns1:out> node into a string variable. You get to it with an xPath similar to /process_data/xmlresponse/soap:Body/nsl:getXMLExtractForAClaimResponse/nsl:out<br /><br />Note that you need to add the soap and nsl namespaces to the properties of your process for the xPath to work (Right click , Properties, Advanced)<br /><br />2- Use string manipulation to strip the CDATA tags around your the string. You can use the Left and Right function to do that.<br /><br />3- Convert the string xml into a XML variable using the deserialize function in xPath.<br /><br />Jasmin