AnsweredAssumed Answered

GEL script call third party WS - unable to parse error response

Question asked by Lukas_Jezek on Jan 29, 2016
Latest reply on Jan 29, 2016 by nick_darlington

Hello,

 

we have got a GEL script which sends data to TIBCO using SOAP webservice. After the script sends message to TIBCO and receives the result we need to log this as info message in the process instance.

There is no problem if on SAP side is everything OK, but in case of error on SAP side we are not able to log the message and the script throws following error:

 

 

BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:138:79: <soap:invoke> Failed to send a SOAP message generated to 'http://domain:9966/WebServices/ProjectManagement/ProjectManagement-service.serviceagent/ProjectManagementEndpoint'.HTTP Error: Status-Code: 500: Internal Server Error 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.ForEachTag.doTag(ForEachTag.java:150) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: HTTP Error: Status-Code: 500: Internal Server Error at com.niku.union.xml.SimpleSOAPMessage.processRequest(SimpleSOAPMessage.java:316) 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) ... 15 more Root cause java.lang.RuntimeException: HTTP Error: Status-Code: 500: Internal Server Error at com.niku.union.xml.SimpleSOAPMessage.processRequest(SimpleSOAPMessage.java:316) 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) 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.ForEachTag.doTag(ForEachTag.java:150) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

 

 

Here is example of the message we send:

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:dat="http://messaging.ei.domain.net/datatypes"

  xmlns:proj="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement"

  xmlns:proj1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

  <soapenv:Header>

    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

      <wsse:UsernameToken wsu:Id="UsernameToken-3" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

        <wsse:Username>username</wsse:Username>

        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>

        <wsse:Nonce EncodingType=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary”>**********</wsse:Nonce>

        <wsu:Created>2012-08-07T03:08:29.749Z</wsu:Created>

      </wsse:UsernameToken>

    </wsse:Security>

  </soapenv:Header>

  <soapenv:Body>

    <proj:createIRN>

      <proj:eiMessageContext>

        <dat:sender>clarity</dat:sender>

        <dat:correlationId>CREATE_IRN_222222_CLARITY</dat:correlationId>

      </proj:eiMessageContext>

      <proj:data>

        <proj1:IRN>222222/2000</proj1:IRN>

        <proj1:name>32115:***</proj1:name>

        <proj1:startDate>2016-01-20</proj1:startDate>

        <proj1:finishDate>2016-01-20</proj1:finishDate>

        <proj1:PM>010101</proj1:PM>

        <proj1:siteNo>11111</proj1:siteNo>

        <proj1:siteName>site_name</proj1:siteName>

        <proj1:typ>XXXXX</proj1:typ>

        <proj1:USR30/>

        <proj1:USR40>0</proj1:USR40>

      </proj:data>

    </proj:createIRN>

  </soapenv:Body>

</soapenv:Envelope>

 

 

Here is a message we are able to log:

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ns0:createIRNOutput xmlns:ns0="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement"> <proj:eiMessageContext xmlns:dat="http://messaging.ei.domain.net/datatypes" xmlns:ns="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement" xmlns:ns1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement" xmlns:ns2="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement" xmlns:proj="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement" xmlns:proj1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 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_222222_CLARITY</dat:correlationId> </proj:eiMessageContext> <ns0:data> <ns1:RETCODE xmlns:ns1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement">0</ns1:RETCODE> <ns1:RETMSG xmlns:ns1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement">Everything OK</ns1:RETMSG> </ns0:data> </ns0:createIRNOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

 

 

And here is a message we are not able to log:

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

   <SOAP-ENV:Body>

      <SOAP-ENV:Fault>

         <faultcode>SOAP-ENV:Server</faultcode>

         <faultstring>This is an operation implementation generated fault</faultstring>

         <faultactor/>

         <detail>

            <ns:TechnicalExceptionElement xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">

               <dat:eiMessageContext xmlns:dat="http://messaging.ei.domain.net/datatypes" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proj="http://logisticsordermanagement.supplymanagement.domain.cz/ws/services/projectmanagement" xmlns:proj1="http://logisticsordermanagement.supplymanagement.domain.cz/ws/datatypes/projectmanagement">

                  <dat:sender>clarity</dat:sender>

                  <dat:correlationId>CREATE_IRN_222222_CLARITY</dat:correlationId>

               </dat:eiMessageContext>

               <ns1:timestamp xmlns:ns1="http://messaging.ei.domain.net/datatypes">2016-01-29T13:26:59.662+01:00</ns1:timestamp>

               <ns1:originator xmlns:ns1="http://messaging.ei.domain.net/datatypes">SAP_R3</ns1:originator>

               <ns1:exceptionClass xmlns:ns1="http://messaging.ei.domain.net/datatypes">SAP_ERROR</ns1:exceptionClass>

               <ns1:subCode xmlns:ns1="http://messaging.ei.domain.net/datatypes">2</ns1:subCode>

               <ns1:description ns1:lang="en" xmlns:ns1="http://messaging.ei.domain.net/datatypes">No project was chosen - wrong IRN format!</ns1:description>

               <ns1:furtherInfo xmlns:ns1="http://messaging.ei.domain.net/datatypes">No project was chosen - wrong IRN format!</ns1:furtherInfo>

            </ns:TechnicalExceptionElement>

         </detail>

      </SOAP-ENV:Fault>

   </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

 

Please have you got any idea or experience how to solve this and make us able to work even with error response?

 

Thank you all in advance.

Outcomes