Please help me on converting the response in to XML
<gel:script xmlns:core="jelly:core" xmlns:file="jelly:com.niku.union.gel.FileTagLibrary" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
xmlns:jelly="jelly:core" xmlns:nikuq="http://www.niku.com/xog/Query" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sql="jelly:sql"
xmlns:util="jelly:util" xmlns:wss="http://www.boomi.com/connector/wss" xmlns:x="jelly:org.apache.commons.jelly.tags.xml.XMLTagLibrary"
xmlns:xog="http://www.niku.com/xog" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--***************************************Get the session from the system Start ***********************************-->
<gel:parameter default="" var="APIToken"/>
<gel:parameter default="https://xxxenv.xxxapp.com/rest/align/api/2" var="baseURL1"/>
<gel:parameter default="/Themes?$filter=developmentalStepId%20eq%2016" var="baseURL2"/>
<gel:setDataSource dbId="niku"/>
<!--Set parameter here End -->
<!--***************************************Get the session from the system End ***********************************-->
<!-- StringBuilder for the output -->
<core:set var='baseURL' value='https://xxxtest.xxxapp.com/rest/align/api/2/Themes?filter=developmentalStepId%20eq%2016&lastUpdatedDate%3E2022-01-25T12%3A35%3A27Z' />
<core:new className="java.lang.StringBuilder" var="stringBuilder"/>
<gel:log level="INFO">APIToken : ${APIToken} </gel:log>
<core:new className="org.apache.http.client.methods.HttpGet" var="patch">
<core:arg type="java.lang.String" value="${baseURL}"/>
</core:new>
<core:invoke method="setHeader" on="${patch}">
<core:arg type="java.lang.String" value="Authorization"/>
<core:arg type="java.lang.String" value="${APIToken}"/>
</core:invoke>
<core:invoke method="setHeader" on="${patch}">
<core:arg type="java.lang.String" value="Content-Type"/>
<core:arg type="java.lang.String" value="application/json"/>
</core:invoke>
<core:invoke method="setHeader" on="${patch}">
<core:arg type="java.lang.String" value="Accept"/>
<core:arg type="java.lang.String" value="application/json"/>
</core:invoke>
<core:invoke method="setHeader" on="${patch}">
<core:arg type="java.lang.String" value="setRequestMethod"/>
<core:arg type="java.lang.String" value="GET"/>
</core:invoke>
<core:invokeStatic className="org.apache.http.impl.client.HttpClients" method="createDefault" var="httpclient"/>
<core:invoke method="execute" on="${httpclient}" var="response">
<core:arg type="org.apache.http.client.methods.HttpGet" value="${patch}"/>
</core:invoke>
<gel:log>response: ${response}</gel:log>
<core:invoke method="getEntity" on="${response}" var="entityResponse"/>
<gel:log>entityResponse: ${entityResponse.getContent()}</gel:log>
<core:invoke method="getContent" on="${entityResponse}" var="responsebody"/>
<gel:log>responsebody: ${responsebody}</gel:log>
<core:invoke method="getStatusLine" on="${response}" var="ResponseStatus"/>
<gel:log>ResponseStatus getProtocolVersion: ${ResponseStatus.getProtocolVersion()}</gel:log>
<gel:log>ResponseStatus getReasonPhrase: ${ResponseStatus.getReasonPhrase()}</gel:log>
<gel:log>ResponseStatus getStatusCode: ${ResponseStatus.getStatusCode()}</gel:log>
<gel:log>entityResponse: ${entityResponse.getContent()}</gel:log>
<core:set value="${responsebody}" var="httpInputStream1"/>
<core:new className="java.io.InputStreamReader" var="v_Input1">
<core:arg type="java.io.InputStream" value="${httpInputStream1}"/>
</core:new>
<core:new className="java.io.BufferedReader" var="v_InputData1">
<core:arg type="java.io.Reader" value="${v_Input1}"/>
</core:new>
<core:set value="${v_InputData1.readLine()}" var="ClarityProjectInfo"/>
<gel:log>httpData: ${ClarityProjectInfo}</gel:log>
</gel:script>
Original Message:
Sent: Jun 28, 2019 02:58 AM
From: Prashank Singh
Subject: Re: Can CA PPM invoke a JSON WebService? How?
Hi @Gustavo de Almeida / DATAPREV,
My Blogs were not migrated, however i have received a backup copy of these and will be creating blogs in PPM community.
Meanwhile if you are looking for Blog to use REST API or consuming REST API in GEL then you can visit site: Pemari Blog
1) GEL Script consuming CA PPM REST API
2) CA PPM REST API
Regards,
Prashank Singh
------------------------------
Lead Consultant
Pemari Technology
Original Message:
Sent: 06-27-2019 05:06 PM
From: Gustavo de Almeida
Subject: Re: Can CA PPM invoke a JSON WebService? How?
Hi @Prashank Singh,
I cannot access the link to the blog post. I believe it was not migrated to this new platform. Is there anyway you can recreate the blog post here?
Regards,
Gustavo
Original Message:
Sent: 01-08-2019 02:36 AM
From: Prashank Singh
Subject: Re: Can CA PPM invoke a JSON WebService? How?
You just need to change httpRESTURL value and it will work for external web services as well. Try hard coding the url and then set property accordingly. let me know if you need any help with that.