Clarity

  • 1.  SOAP Error Message

    Posted Dec 07, 2015 05:36 PM

    I am working on a gel script to select project data from Clarity and then send it in a SOAP envelope to an endpoint outside Clarity.

     

    I am getting the following error message but can't figure out what it is telling me but it seems to be with sending the SOAP message to the endpoint. Note the endpoint does not require any login.

     

    java.lang.Exception

            at com.niku.bpm.services.ExecuteCustomAction.actionCompleted(ExecuteCustomAction.java:333)
            at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:258)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                                                                       at java.lang.Thread.run(Thread.java:744)

    I can post the full script but wanted to see if the error message was one that somebody has seen before.


     

     



  • 2.  Re: SOAP Error Message

    Posted Dec 07, 2015 11:31 PM

    Well java.lang.Exception points to an unhanded exception (the worst kind to debug) in the actionCompleted method contained in the ExecuteCustomAction class. In any of the other logs do you get a better exception log entry?  You might have to turn on more logging to get additional information.

    V/r,

    Gene



  • 3.  Re: SOAP Error Message

    Posted Dec 08, 2015 10:14 AM

    We will need other details than the part posted.

     

    Are there other related entries for this same script thread in the logs?  More to the stack trace?  Did you emit a <gel:log> in the script at ERROR or FATAL levels anywhere?

     

    The part of the stack trace provided to us is only the part that checks after a script stops executing to see if it completed normally or not; since it did not, you receive this response - it's therefore too generic and more details will be needed to arrive at any conclusions.



  • 4.  Re: SOAP Error Message

    Posted Dec 08, 2015 11:21 AM
      |   view attached

    Thanks for the suggestions. I am adding the full script.

     

    @gcubed

    I did see a post of yours that I have been looking at. Calling external SOAP from Clarity GEL

    In my case, I am sending a SOAP message for a service to consume not requesting information.

     

    Do I still need this connection code?

    <!-- Open a connection to ServiceNow and set our request headers -->

    26.    <core:new var="soapUrl" className="java.net.URL">

    27.        <core:arg type="java.lang.String" value="${soapEndPoint}" />

    28.    </core:new>

    29.    <core:invoke var="connection" on="${soapUrl}" method="openConnection"/>

    30.    <core:expr value="${connection.setDoOutput(true)}" />

    31.    <core:expr value='${connection.setRequestMethod("POST")}'/>

    32.    <core:expr value='${connection.setRequestProperty("Content-type", "text/xml; charset=utf-8")}'/>

    33.    <core:expr value='${connection.setRequestProperty("SOAPAction", soapEndPoint)}'/>

    34.    <core:expr value='${connection.setRequestProperty("Authorization", basicAuth)}'/>

    35.    <core:set var="requestXml">



  • 5.  Re: SOAP Error Message
    Best Answer

    Posted Dec 08, 2015 05:11 PM

    The first thing I noticed is that

     

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

     

    Should be: (you close the gel:script tag before your ser namespace) .

     

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

     

    The second thing is this doesn't look like an endpoint:

     

    <core:set var="target_endpoint" value="http://vmkid-pkiosk01:8040/services/omap/projectDataSOAP?WSDL"/>
    

     

    I would suggest downloading SOAPUI.  You can then open a new project base on your wsdl above and it will then tell you what endpoints are available.  In addition, you will be able to test your $score_xog payload.  Just serialized it to a file and use that in a request.

    <gel:include select="$score_xog"/> 
    <gel:serialize fileName="score_xog.xml" var="${score_xog}"/>
    

     

    You should be able to just use <soap:invoke> as Nick mention in

     

    Calling external SOAP from Clarity GEL

     

     

    V/r,

    Gene



  • 6.  Re: SOAP Error Message

    Posted Dec 09, 2015 09:09 AM
      |   view attached

    Thanks Gene,

    I did try SOAPUI using the $score_xog xml. It worked fine. The endpoint I ended up using was without the ?WSDL at the end.

     

    I then created a simple script with the body of the message hard coded instead of included. That worked fine as well.

     

    I went through the script again and then realized that I had included the soap envelope, header and body tags when I parsed the ${score_xog} and included them all again when I did the SOAP invoke. Once I cleaned that up, everything worked perfectly.

     

    Appreciate your help. It got me on the correct diagnosis path.

    I am including the final script for reference.