Clarity

  • 1.  Failed to send SOAP Message

    Posted Jun 27, 2016 05:32 PM

    Hi All,

     

    I am new to gel scripting in a cloud environment and am trying to set up script that will copy data from the project object to a custom object.

    I have a gel script which contains the sql to pull together the data I need between the project object and our custom object (funding).. The process is kicked off via an action but fails with the following message..

     

    BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:170:66: <soap:invoke> Failed to send a SOAP message generated to 'https://cppm6124-dev.ondemand.ca.com:14001/niku/xog'.No route to host at com.niku.union.gel.tags.soap.InvokeTag.doTag(InvokeTag.java:76) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:42) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:42) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:67) at com.niku.union.gel.GELController.invoke(GELController.java:74) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:207) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) at com.niku.union.xml.SimpleSOAPMessage.processRequest(SimpleSOAPMessage.java:306) at com.niku.union.xml.SimpleSOAPMessage.send(SimpleSOAPMessage.java:88) at com.niku.union.xml.SimpleSOAPMessage.send(SimpleSOAPMessage.java:63) at com.niku.union.gel.tags.soap.InvokeTag.doTag(InvokeTag.java:72) ... 19 more Root cause java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Soc...

     

    I have been using a template gel script provided by CA, which is below.. I have commented out the section on port number as per advice from CA, as I was receiving a similar error when this was in place..

     

    <gel:script xmlns:core="jelly:core"
        xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
        xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:sql="jelly:sql" xmlns:util="jelly:util"
        xmlns:xog="http://www.niku.com/xog"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <gel:setDataSource dbId="Niku"/>
       
    <!-- Initialise Variables -->
        <core:set var="v_errorFlag">false</core:set>

        <!-- Retrieve the username of the XOG user from the Code Constants table -->
        <core:catch var="v_exception">
            <sql:query var="v_queryXogUserId">
                SELECT d_value
                FROM odf_ca_d_code_const
                WHERE code ='xoguser'
             </sql:query>
        </core:catch>
        <core:if test="${v_exception != null and v_queryXogUserId.rowCount == 0}">
            <core:set value="true" var="v_errorFlag"/>
            <gel:out>[SQL] Unable to retrieve XOG USER ID from the Database: ${v_exception}</gel:out>
            <gel:log category="SQL" level="ERROR">Unable to retrieve XOG USER ID from the database: ${v_exception}</gel:log>
        </core:if>
        <core:if test="${v_errorFlag==false}">
            <core:set var="v_xogUserId">${v_queryXogUserId.rows[0].d_value}</core:set>
        </core:if>

        <!-- Retrieve a Session ID to be sent with the XOG package as authentication -->
        <core:if test="${v_errorFlag == false}">
            <core:catch var="v_exception">
               
       <!--Invoke class instances-->
                <core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="v_secId"/>
                <core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/>
                <!--Log into clarity by initialising class instance-->
                <core:set value="${userSessionCtrl.init(v_xogUserId, v_secId)}" var="v_secId"/>
                <core:set value="${v_secId.getSessionId()}" var="v_thisSessionId"/>
            </core:catch>
            <core:if test="${v_exception!=null}">
                <core:set value="true" var="v_errorFlag"/>
                <gel:out>[GEL] Unable to retrieve a Session ID: ${v_exception}</gel:out>
                <gel:log category="GEL" level="ERROR">Unable to retrieve a Session ID: ${v_exception}</gel:log>
            </core:if>
        </core:if>
       
    <!--Retrieve the clarity application server URL-->
        <core:if test="${v_errorFlag == false}">
            <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>
            <!--Always use Scheduler URL first-->
            <core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
            <!--If Scheduler URL is not set use the Application Server Entry URL-->
            <core:if test="${v_clarityURL == ''}">
                <core:switch on="${v_config.getProperties().getWebServer().getWebServerInstance(0).getId()}">
                    <core:case value="nsa">
                        <core:set
                            value="${v_config.getProperties().getWebServer().getWebServerInstance(1).getEntryUrl()}" var="v_entryURL"/>
                    </core:case>
                    <core:default>
                        <core:set
                            value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getEntryUrl()}" var="v_entryURL"/>
                    </core:default>
                </core:switch>
                <core:set value="${v_entryURL}" var="v_clarityURL"/>
            </core:if>
            <util:tokenize delim=":" var="v_urlComponents">${v_clarityURL}</util:tokenize>
            <core:set value="${v_urlComponents.get(0)}://" var="v_httpMethod"/>
            <core:set value="${v_urlComponents.get(1)}" var="v_serverName"/>
            <util:tokenize delim="/" var="v_serverName">${v_serverName}</util:tokenize>
            <core:set value="${v_serverName.get(0)}" var="v_serverName"/>
            <core:set value="${v_urlComponents.get(2)}" var="v_portNumber"/>
            <!--Determine if port number is present in entry URL. If not use App Server Entry port.-->
            <!-- <core:choose>
                <core:when test="${v_portNumber == null}">
                    <core:set
                        value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getPort()}" var="v_portNumber"/>
                </core:when>
                <core:otherwise>
                    <util:tokenize delim="/" var="v_portNumber">${v_portNumber}</util:tokenize>
                    <core:set value="${v_portNumber.get(0)}" var="v_portNumber"/>
                </core:otherwise>
            </core:choose>
            <core:set
                value="${v_httpMethod}${v_serverName}:${v_portNumber}/niku/xog" var="v_clarityURL"/>
        </core:if> -->

        <!-- SQL Query to get Required Attributes for the XOG -->
        <core:if test="${v_errorFlag == false}">
            <core:catch var="v_exception">
                <sql:query var="v_query_result" escapeText="0">  
                    SELECT   fu.code,                                       
                    F.PLANNED_CST_START, 
                    F.PLANNED_CST_CAPITAL_TOTAL,
                    F.PLANNED_CST_OPERATING_TOTAL,
                    F.PLANNED_CST_TOTAL,
                    F.PLANNED_CST_FINISH,
                    F.PLANNED_BEN_TOTAL,
                    F.PLANNED_NPV,
                    F.PLANNED_PAYBACK_PERIOD,
                    F.PLANNED_ROI
                    FROM niku.FIN_FINANCIALS F,
                    niku.INV_INVESTMENTS I,
                    niku.odf_ca_f_funding fu
                    where i.id = f.id
                    and i.id = fu.odf_parent_id                                               
                    WHERE fu.id = ${gel_objectInstanceId}     
                </sql:query>
            </core:catch>
            <core:if test="${v_exception != null}">
                <core:set value="true" var="v_errorFlag"/>
                <gel:log category="Select Key Indicators" level="ERROR">Query for Key Indicators attributes failed. Report ${gel_objectInstanceId} Exception: ${v_exception.getMessage()}</gel:log>
            </core:if>
     
        <!-- Store the results of the query into variables --> 
            <core:if test="${v_exception eq null}">
                <core:forEach items="${v_query_result.rowsByIndex}" trim="true" var="row">
                    <core:set var="v_fundingID">${row[0]}</core:set>
                    <core:set var="v_planned_cst_start">${row[1]}</core:set>
        <core:set var="v_planned_cst_cap_tot">${row[2]}</core:set>
        <core:set var="v_planned_cst_op_tot">${row[3]}</core:set>
        <core:set var="v_planned_cst_tot">${row[4]}</core:set>
        <core:set var="v_planned_cst_finish">${row[5]}</core:set>   
        <core:set var="v_planned_ben_tot">${row[6]}</core:set>
        <core:set var="v_planned_npv">${row[7]}</core:set>
        <core:set var="v_planned_payback_per">${row[8]}</core:set>
        <core:set var="v_planned_roi">${row[9]}</core:set>
                </core:forEach>          
        <!-- Create the XOG Write XML using the variables -->
            <gel:parse var="v_xml_root">
                         
        <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
         <Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="14.4.0.234"/>   
          <customObjectInstances objectCode="f_funding">
           <instance instanceCode="${v_fundingID}" objectCode="f_funding">
            <CustomInformation>
             <ColumnValue name="f_plnd_cost_st">${v_planned_cst_start}</ColumnValue>
             <ColumnValue name="f_pland_cap">${v_planned_cst_cap_tot}</ColumnValue>
             <ColumnValue name="f_plnd_op">${v_planned_cst_op_tot}</ColumnValue>
             <ColumnValue name="f_plnd_cst">${v_planned_cst_tot}</ColumnValue>
             <ColumnValue name="f_pln_cst_fin">${v_planned_cst_finish}</ColumnValue>
             <ColumnValue name="f_pr_fin_be">${v_planned_ben_tot}</ColumnValue>
             <ColumnValue name="f_plnd_npv">${v_planned_npv}</ColumnValue>
             <ColumnValue name="f_plnd_pback_per">${v_planned_payback_per}</ColumnValue>
             <ColumnValue name="f_plnd_roi">${v_planned_roi}</ColumnValue>
            </CustomInformation>
           </instance>
          </customObjectInstances>
        </NikuDataBus>
            </gel:parse>
               
    <!-- XOG into Clarity -->
                <core:catch var="v_xog_exception">
                    <soap:invoke endpoint="${v_clarityURL}" var="runresult">
                        <soap:message>
                            <soapenv:Envelope
                                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
                                <soapenv:Header>
                                    <xog:Auth>
                                        <xog:SessionID>${v_thisSessionId}</xog:SessionID>
                                    </xog:Auth>
                                </soapenv:Header>
                                <soapenv:Body>
                                    <gel:include select="$v_xml_root/NikuDataBus"/>
                                </soapenv:Body>
                            </soapenv:Envelope>
                        </soap:message>
                    </soap:invoke>
                </core:catch>
                <core:choose>
                    <core:when test="${v_xog_exception != null}">
                        <gel:log category="XOG" level="WARNING">XOG to calculate Overall Status failed.</gel:log>
                    </core:when>
                    <core:otherwise>
                        <!--  Check the XOG result  -->
                        <gel:set
                            select="$runresult/soapenv:Envelope/soapenv:Body/XOGOutput" var="writeOutputRoot"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Status/@state" var="XOGoutcome"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Records/Record" var="XOGoutputrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@totalNumberOfRecords" var="XOGtotalrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@insertedRecords" var="XOGinsertedrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@updatedRecords" var="XOGupdatedrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@failureRecords" var="XOGfailurerecords"/>
         <gel:log category="Overall Status" level="INFO">Overall Status is: ${v_overallStatus}]</gel:log>
                        <gel:log category="XOG" level="INFO">XOG operation completed [Total ${XOGtotalrecords}, Inserted ${XOGinsertedrecords}, Updated ${XOGupdatedrecords}, Failed ${XOGfailurerecords}]</gel:log>
                    </core:otherwise>
                </core:choose>
       
    <!--  CLOSE DOWN THE SESSION -->
                <soap:invoke endpoint="${v_clarityURL}" var="logoutresult">
                    <soap:message>
                        <soapenv:Envelope
                            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
                            <soapenv:Header>
                                <xog:Auth>
                                    <xog:SessionID>${v_thisSessionId}</xog:SessionID>
                                </xog:Auth>
                            </soapenv:Header>
                            <soapenv:Body>
                                <xog:Logout/>
                            </soapenv:Body>
                        </soapenv:Envelope>
                    </soap:message>
                </soap:invoke>
         <!-- End of XOG Update Code -->
            </core:if>
        </core:if>
    </gel:script>

     

     

    Any ideas where I might be going wrong? All suggestions would be most appreciated.

    Thanks

    Michelle



  • 2.  Re: Failed to send SOAP Message

    Posted Jun 27, 2016 08:57 PM

    You need to the core set to add the niku/xog

     

    should be (removed the v_portNumber)

     

    I normally just

    <?xml version="1.0" encoding="utf-8"?>
    <gel:script xmlns:core="jelly:core"
        xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
        xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:sql="jelly:sql" xmlns:util="jelly:util"
        xmlns:xog="http://www.niku.com/xog"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            
            <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>
            <!--Always use Scheduler URL first-->
            <core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
            <gel:log>${v_clarityURL}</gel:log>
            <core:set value="${v_clarityURL}/niku/xog" var="v_clarityURL"/>
            <gel:log>${v_clarityURL}</gel:log>
        </gel:script>
    

     

     

    There might be some change in 14.4 with the ConfigurationManager that might also be giving you issues -- we on 14.3.

     

    V/r,

    Gene



  • 3.  Re: Failed to send SOAP Message

    Posted Jul 03, 2016 07:06 PM

    Hi gcubed,

     

    Thanks for much for your speedy response. Unfortunately l am still receiving the same error.

     

    The first action I took was as per your suggestion above. I updated the commenting to re-add the core set and removed the reference to v_portNumber. The error was the same.. unable to send SOAP message.

     

    I then added the additional lines of code from your 3rd screenshot, and still the same error. Unable to send SOAP message:-

     

    BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:170:66: <soap:invoke> Failed to send a SOAP message generated to 'https://cppm6124-dev.ondemand.ca.com:14001/niku/xog'.No route to host at com.niku.union.gel.tags.soap.InvokeTag.doTag(InvokeTag.java:76) at org.apache.commons.jelly.impl.TagScript

     

    I then tried un-commenting out the whole section on "Determine if port number is present in entry URL".. still the same error..

     

    This is what I have now..

     

    <gel:script xmlns:core="jelly:core"
        xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
        xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:sql="jelly:sql" xmlns:util="jelly:util"
        xmlns:xog="http://www.niku.com/xog"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>

    <!--Always user Scheduler URL first-->
    <core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
    <gel:log>${v_clarityURL}</gel:log>
    <core:set value="${v_clarityURL}/niku/xog" var="v_clarityURL"/>
    <gel:log>${v_clarityURL}</gel:log>

    <gel:setDataSource dbId="Niku"/>
       
    <!-- Initialise Variables -->
        <core:set var="v_errorFlag">false</core:set>

        <!-- Retrieve the username of the XOG user from the Code Constants table -->
        <core:catch var="v_exception">
            <sql:query var="v_queryXogUserId">
                SELECT d_value
                FROM odf_ca_d_code_const
                WHERE code ='xoguser'
             </sql:query>
        </core:catch>
        <core:if test="${v_exception != null and v_queryXogUserId.rowCount == 0}">
            <core:set value="true" var="v_errorFlag"/>
            <gel:out>[SQL] Unable to retrieve XOG USER ID from the Database: ${v_exception}</gel:out>
            <gel:log category="SQL" level="ERROR">Unable to retrieve XOG USER ID from the database: ${v_exception}</gel:log>
        </core:if>
        <core:if test="${v_errorFlag==false}">
            <core:set var="v_xogUserId">${v_queryXogUserId.rows[0].d_value}</core:set>
        </core:if>

        <!-- Retrieve a Session ID to be sent with the XOG package as authentication -->
        <core:if test="${v_errorFlag == false}">
            <core:catch var="v_exception">
               
       <!--Invoke class instances-->
                <core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="v_secId"/>
                <core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/>
                <!--Log into clarity by initialising class instance-->
                <core:set value="${userSessionCtrl.init(v_xogUserId, v_secId)}" var="v_secId"/>
                <core:set value="${v_secId.getSessionId()}" var="v_thisSessionId"/>
            </core:catch>
            <core:if test="${v_exception!=null}">
                <core:set value="true" var="v_errorFlag"/>
                <gel:out>[GEL] Unable to retrieve a Session ID: ${v_exception}</gel:out>
                <gel:log category="GEL" level="ERROR">Unable to retrieve a Session ID: ${v_exception}</gel:log>
            </core:if>
        </core:if>
       
    <!--Retrieve the clarity application server URL-->
        <core:if test="${v_errorFlag == false}">
            <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>
            <!--Always use Scheduler URL first-->
            <core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
            <!--If Scheduler URL is not set use the Application Server Entry URL-->
            <core:if test="${v_clarityURL == ''}">
                <core:switch on="${v_config.getProperties().getWebServer().getWebServerInstance(0).getId()}">
                    <core:case value="nsa">
                        <core:set
                            value="${v_config.getProperties().getWebServer().getWebServerInstance(1).getEntryUrl()}" var="v_entryURL"/>
                    </core:case>
                    <core:default>
                        <core:set
                            value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getEntryUrl()}" var="v_entryURL"/>
                    </core:default>
                </core:switch>
                <core:set value="${v_entryURL}" var="v_clarityURL"/>
            </core:if>
            <util:tokenize delim=":" var="v_urlComponents">${v_clarityURL}</util:tokenize>
            <core:set value="${v_urlComponents.get(0)}://" var="v_httpMethod"/>
            <core:set value="${v_urlComponents.get(1)}" var="v_serverName"/>
            <util:tokenize delim="/" var="v_serverName">${v_serverName}</util:tokenize>
            <core:set value="${v_serverName.get(0)}" var="v_serverName"/>
            <core:set value="${v_urlComponents.get(2)}" var="v_portNumber"/>
            <!--Determine if port number is present in entry URL. If not use App Server Entry port.-->
            <core:choose>
                <core:when test="${v_portNumber == null}">
                    <core:set                    value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getPort()}" var="v_portNumber"/>
                </core:when>
                <core:otherwise>
                    <util:tokenize delim="/" var="v_portNumber">${v_portNumber}</util:tokenize>
                    <core:set value="${v_portNumber.get(0)}" var="v_portNumber"/>
                </core:otherwise>
            </core:choose>
            <core:set
                value="${v_httpMethod}${v_serverName}/niku/xog" var="v_clarityURL"/>
        </core:if>

        <!-- SQL Query to get Required Attributes for the XOG -->
        <core:if test="${v_errorFlag == false}">
            <core:catch var="v_exception">
                <sql:query var="v_query_result" escapeText="0">  
                    SELECT   fu.code,                                       
                    F.PLANNED_CST_START, 
                    F.PLANNED_CST_CAPITAL_TOTAL,
                    F.PLANNED_CST_OPERATING_TOTAL,
                    F.PLANNED_CST_TOTAL,
                    F.PLANNED_CST_FINISH,
                    F.PLANNED_BEN_TOTAL,
                    F.PLANNED_NPV,
                    F.PLANNED_PAYBACK_PERIOD,
                    F.PLANNED_ROI
                    FROM niku.FIN_FINANCIALS F,
                    niku.INV_INVESTMENTS I,
                    niku.odf_ca_f_funding fu
                    where i.id = f.id
                    and i.id = fu.odf_parent_id                                               
                    WHERE fu.id = ${gel_objectInstanceId}     
                </sql:query>
            </core:catch>
            <core:if test="${v_exception != null}">
                <core:set value="true" var="v_errorFlag"/>
                <gel:log category="Select Key Indicators" level="ERROR">Query for Key Indicators attributes failed. Report ${gel_objectInstanceId} Exception: ${v_exception.getMessage()}</gel:log>
            </core:if>
     
        <!-- Store the results of the query into variables --> 
            <core:if test="${v_exception eq null}">
                <core:forEach items="${v_query_result.rowsByIndex}" trim="true" var="row">
                    <core:set var="v_fundingID">${row[0]}</core:set>
                    <core:set var="v_planned_cst_start">${row[1]}</core:set>
        <core:set var="v_planned_cst_cap_tot">${row[2]}</core:set>
        <core:set var="v_planned_cst_op_tot">${row[3]}</core:set>
        <core:set var="v_planned_cst_tot">${row[4]}</core:set>
        <core:set var="v_planned_cst_finish">${row[5]}</core:set>   
        <core:set var="v_planned_ben_tot">${row[6]}</core:set>
        <core:set var="v_planned_npv">${row[7]}</core:set>
        <core:set var="v_planned_payback_per">${row[8]}</core:set>
        <core:set var="v_planned_roi">${row[9]}</core:set>
                </core:forEach>          
        <!-- Create the XOG Write XML using the variables -->
            <gel:parse var="v_xml_root">
                         
        <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
         <Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="14.4.0.234"/>   
          <customObjectInstances objectCode="f_funding">
           <instance instanceCode="${v_fundingID}" objectCode="f_funding">
            <CustomInformation>
             <ColumnValue name="f_plnd_cost_st">${v_planned_cst_start}</ColumnValue>
             <ColumnValue name="f_pland_cap">${v_planned_cst_cap_tot}</ColumnValue>
             <ColumnValue name="f_plnd_op">${v_planned_cst_op_tot}</ColumnValue>
             <ColumnValue name="f_plnd_cst">${v_planned_cst_tot}</ColumnValue>
             <ColumnValue name="f_pln_cst_fin">${v_planned_cst_finish}</ColumnValue>
             <ColumnValue name="f_pr_fin_be">${v_planned_ben_tot}</ColumnValue>
             <ColumnValue name="f_plnd_npv">${v_planned_npv}</ColumnValue>
             <ColumnValue name="f_plnd_pback_per">${v_planned_payback_per}</ColumnValue>
             <ColumnValue name="f_plnd_roi">${v_planned_roi}</ColumnValue>
            </CustomInformation>
           </instance>
          </customObjectInstances>
        </NikuDataBus>
            </gel:parse>
               
    <!-- XOG into Clarity -->
                <core:catch var="v_xog_exception">
                    <soap:invoke endpoint="${v_clarityURL}" var="runresult">
                        <soap:message>
                            <soapenv:Envelope
                                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
                                <soapenv:Header>
                                    <xog:Auth>
                                        <xog:SessionID>${v_thisSessionId}</xog:SessionID>
                                    </xog:Auth>
                                </soapenv:Header>
                                <soapenv:Body>
                                    <gel:include select="$v_xml_root/NikuDataBus"/>
                                </soapenv:Body>
                            </soapenv:Envelope>
                        </soap:message>
                    </soap:invoke>
                </core:catch>
                <core:choose>
                    <core:when test="${v_xog_exception != null}">
                        <gel:log category="XOG" level="WARNING">XOG to calculate Overall Status failed.</gel:log>
                    </core:when>
                    <core:otherwise>
                        <!--  Check the XOG result  -->
                        <gel:set
                            select="$runresult/soapenv:Envelope/soapenv:Body/XOGOutput" var="writeOutputRoot"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Status/@state" var="XOGoutcome"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Records/Record" var="XOGoutputrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@totalNumberOfRecords" var="XOGtotalrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@insertedRecords" var="XOGinsertedrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@updatedRecords" var="XOGupdatedrecords"/>
                        <gel:set asString="true"
                            select="$writeOutputRoot/Statistics/@failureRecords" var="XOGfailurerecords"/>
         <gel:log category="Overall Status" level="INFO">Overall Status is: ${v_overallStatus}]</gel:log>
                        <gel:log category="XOG" level="INFO">XOG operation completed [Total ${XOGtotalrecords}, Inserted ${XOGinsertedrecords}, Updated ${XOGupdatedrecords}, Failed ${XOGfailurerecords}]</gel:log>
                    </core:otherwise>
                </core:choose>
       
    <!--  CLOSE DOWN THE SESSION -->
                <soap:invoke endpoint="${v_clarityURL}" var="logoutresult">
                    <soap:message>
                        <soapenv:Envelope
                            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
                            <soapenv:Header>
                                <xog:Auth>
                                    <xog:SessionID>${v_thisSessionId}</xog:SessionID>
                                </xog:Auth>
                            </soapenv:Header>
                            <soapenv:Body>
                                <xog:Logout/>
                            </soapenv:Body>
                        </soapenv:Envelope>
                    </soap:message>
                </soap:invoke>
         <!-- End of XOG Update Code -->
            </core:if>
        </core:if>
    </gel:script>

     

     

    Would appreciate any assistance possible..

     

    Thanks

    Michelle



  • 4.  Re: Failed to send SOAP Message

    Broadcom Employee
    Posted Jul 04, 2016 02:12 AM

    Hi Michelle,

     

    I see you are trying to use port 14001 with https and that's not possible. Any reason for using the particular port.

     

    'https://cppm6124-dev.ondemand.ca.com:14001/niku/xog'.No

     

    Regards

    Suman Pramanik



  • 5.  Re: Failed to send SOAP Message

    Posted Jul 04, 2016 02:45 AM

    Hi Suman,

     

    Are you referring to section under the header "<!--Determine if port number is present in entry URL. If not use App Server Entry port.-->"?

     

    If so, I had already commented this out previously based upon a recommendation from CA. I had only just brought it back, in case I misunderstood what they had advised..

     

    I had followed the advice of gcubed and included only the core:set from this section..

     

    Unfortunately, I am still receiving the same error..

     

    Thanks for the feedback Suman :-)

     

    Michelle



  • 6.  Re: Failed to send SOAP Message

    Posted Jul 04, 2016 05:21 PM

    So not sure where the port number is coming form but try:

    After the core:set log out the v_clarityURL then hard cod in the url to see what is being calcuation vs what should be the value for XOG.

     

    <core:set
        value="${v_httpMethod}${v_serverName}/niku/xog" var="v_clarityURL"/>
    </core:if>
    
    <!-- Add these lines to log out the values of v_clarityURL  -->
    <!-- See where we are going to XOG base on configuration manager -->
    <gel:log>${v_clarityURL}</gel:log>
    
    <!-- Hardwire our endpoint -->
    <core:set value="https://cppm6124-dev.ondemand.ca.com/niku/xog" var="v_clarityURL" />
    <!-- See where we are going to XOG to -->
    <gel:log>${v_clarityURL}</gel:log>
    

     

    V/r,

    Gene



  • 7.  Re: Failed to send SOAP Message

    Posted Jul 04, 2016 07:28 PM

    Hi Gene,

     

    Thanks for the feedback. I have incorporated the lines of code you have provided and have re-run my process to execute the script. Where do I find the gel log to check these values?

     

    I have gone in action:security.logs within PPM and have been through all of these and can't find these values.. How do you usually check the outputs?

     

    Thanks

    Michelle



  • 8.  Re: Failed to send SOAP Message

    Posted Jul 04, 2016 07:37 PM

    Go to Initiated Process tab and click on the messages icon for your process.

     

     

    V/r,

    Gene



  • 9.  Re: Failed to send SOAP Message

     
    Posted Jun 30, 2016 07:58 PM

    Hi MichelleSergeant82220975 - Did gcubed's response help answer your question? If so please mark as Correct Answer. Thanks!