AnsweredAssumed Answered

[GEL] log text from soap web-service

Question asked by StKirill on Nov 1, 2012
Latest reply on Nov 5, 2012 by StKirill
hi, i'm trying to log text from ws in Clarity process

soap web-service returns following xml:
<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">
  <soap:Body>
    <GelResultTestResponse xmlns="www.website.com">
      <GelResultTestResult>someresult</GelResultTestResult>
    </GelResultTestResponse>
  </soap:Body>
</soap:Envelope>
i'm trying to extract only "sometext" from it -- /soap:Envelope/soap:Body/GelResultTestResponse/GelResultTestResult/text()

to simplify the example, i've omitted soap invoking of web-method and initialized xml directly from text
<gel:script
    xmlns:core="jelly:core"
    xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary">
<gel:parse var="result">
<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">
  <soap:Body>
    <GelResultTestResponse xmlns="www.website.com">
      <GelResultTestResult>someresult</GelResultTestResult>
    </GelResultTestResponse>
  </soap:Body>
</soap:Envelope>
</gel:parse>
<gel:serialize fileName="C:\temp\clarity-asdf.log" var="${result}"/>
  <gel:set select="$result/soap:Envelope/soap:Body/GelResultTestResponse/GelResultTestResult/text()" var="restext" asString="true"/>
  <gel:log level="INFO" message="premessage ${restext} postmessage" />
</gel:script>
then i'm logging this xml to "C:\temp\clarity-asdf.log" and in this file xml looks exactly how i initialized it
after that i'm trying to extract inner text from specific node
and finally i'm trying to log this message, but i see only "premessage postmessage", so the variable ${restext} is empty

please, help me to log result from soap

Outcomes