AnsweredAssumed Answered

GEL - Xpath syntax

Question asked by lukas.jezek on Aug 3, 2012
Latest reply on Aug 23, 2012 by nick_darlington
Hi all,

I have a problem to find what I need. I have a request to the third party webservice and I got response as follows:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>

<ns0:createIRNOutput xmlns:ns0="http://mydomain">


<proj:eiMessageContext xmlns:dat="http://mydomain" xmlns:proj="http://mydomain" xmlns:proj1="http://mydomain" xmlns:soapenv="http://mydomain" xmlns:xog="http://www.niku.com/xog" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">



<dat:sender>CLARITY</dat:sender>



<dat:correlationId>CREATE_IRN_30_CLARITY</dat:correlationId>


</proj:eiMessageContext>


<ns0:data>



<ns1:RETCODE xmlns:ns1="http://mydomain">0</ns1:RETCODE>



<ns2:RETMSG xmlns:ns2="http://mydomain">Everything OK</ns2:RETMSG>


</ns0:data>

</ns0:createIRNOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And now I am using <gel:set tag and tried to save some outputs of the response into the variable:
<gel:set asString="true" select="$nrrunresult//SOAP-ENV:Envelope/SOAP-ENV:Body/ns0:createIRNOutput/ns0:data/ns2:RETMSG/text()" var="retcode_long"/>
But it does not work anyway. I tried all combinations and possibilities which are used in Xpath syntax, but without success. Could anyone help me? In other cases when I send an request to Clarity webservice then it works properly. I also tried
<gel:set asString="true" select="$nrrunresult//*" var="retcode_long"/>
but I got
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>

<ns0:createIRNOutput xmlns:ns0="http://mydomain">


<proj:eiMessageContext xmlns:dat="http://mydomain" xmlns:proj="http://mydomain" xmlns:proj1="http://mydomain" xmlns:soapenv="http://mydomain" xmlns:xog="http://www.niku.com/xog" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">



<dat:sender>CLARITY</dat:sender>



<dat:correlationId>CREATE_IRN_30_CLARITY</dat:correlationId>


</proj:eiMessageContext>


<ns0:data>



<ns1:RETCODE xmlns:ns1="http://mydomain">0</ns1:RETCODE>



<ns2:RETMSG xmlns:ns2="http://mydomain">Everything OK</ns2:RETMSG>


</ns0:data>

</ns0:createIRNOutput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I appreciate any comments and ideas on my problem.
many thanks
Lukas

Outcomes