3 Replies Latest reply on Sep 19, 2008 4:58 AM by Jasmin Charbonneau

    Workbench WebService Invocation: Returning response as CDATA

      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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><br />     <soap:Body><br />          <ns1:getXMLExtractForAClaimResponse xmlns:ns1="http://service.integration.document.eams.edic.com"><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.
        • 1. Re: Workbench WebService Invocation: Returning response as CDATA
          Jasmin Charbonneau Level 4
          I don't see any CData in there.

          Jasmin
          • 2. Re: Workbench WebService Invocation: Returning response as CDATA
            Level 1
            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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><br />     <soap:Body><br />          <ns1:getXMLExtractForAClaimResponse xmlns:ns1="http://service.integration.document.eams.edic.com"><br />               <ns1:out> XML STRING<br /><br /></ns1:out><br />          </ns1:getXMLExtractForAClaimResponse><br />     </soap:Body><br /></soap:Envelope><br /></code>
            • 3. Re: Workbench WebService Invocation: Returning response as CDATA
              Jasmin Charbonneau Level 4
              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