Clarity

 View Only
  • 1.  Failed to send a SOAP message generated

    Posted May 14, 2018 04:36 PM

    Hi I am trying to call the login SDM WebService to do an integration with CA PPM.

     

     

    Calling WebWervice with SOAP UI 

    We can connect to the SDM WebService with success using SOAP UI ( which is running inside the CA PPM Server).

     

    This is the SOAP we are using.:

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">

    <soapenv:Header/>

    <soapenv:Body>

    <ser:login>

    <username><USERNAME></username>

    <password><PASSWORD</password>

    </ser:login>

    </soapenv:Body>

    </soapenv:Envelope>

     

    And I get the correct response returning the <sid>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <soapenv:Body>

    <loginResponse xmlns="http://www.ca.com/UnicenterServicePlus/ServiceDesk">

    <loginReturn xmlns="">1809969298</loginReturn>

    </loginResponse>

    </soapenv:Body>

    </soapenv:Envelope>

     

     

    Calling SDM Webservice using Gel Script

    But when we put it inside the Gel Script to run it from a CA PPM process:

     

    <gel:script xmlns:core="jelly:core" xmlns:file="jelly:com.niku.union.gel.FileTagLibrary" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"

    xmlns:q="http://www.niku.com/xog/Query" xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"

    xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" 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">

     

     

    <soap:invoke endpoint="http://<OUR_SERVER>/axis/services/USD_R11_WebService" var="auth"> <soap:message>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

    xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk" var="auth">

     

    <soapenv:Body>

    <ser:login>

    <username><USERNAME></username>

    <password><PASSWORD</password>

    </ser:login>

    </soapenv:Body>

    </soapenv:Envelope>

    </soap:message>

    </soap:invoke>

    </gel:script>

     

    We get this message process error:

     

    SOAP message generated to 'http://<OUR_SERVER>/axis/services/USD_R11_WebService'.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 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 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) ... 11 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 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

    org.apache.commons.jelly.JellyTagException: null:5:93: <soap:invoke> Failed to send a SOAP message generated to 'http://<OUR_SERVER>/axis/services/USD_R11_WebService'.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 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:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

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

    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)

    ... 11 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 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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

     

    Any Idea of what is going wrong ?



  • 2.  Re: Failed to send a SOAP message generated

    Posted May 14, 2018 05:44 PM

    If you look in SoapUI at the request headers, is it setting a SOAPAction: header?

     

    Many non-PPM web services expect this to be set to a valid value for the web service/method being called, and SoapUI may be populating it automatically.

     

    If it is present/needed, you should add an action="..." parameter to your soap:invoke call with the required value to go into the header.

     

    The logs of the server you were trying to reach may also indicate this or else explain the cause of the error.



  • 3.  Re: Failed to send a SOAP message generated

    Posted May 15, 2018 03:54 AM

    Ummm ; That "Failed to send a SOAP message" error usually happens when the XOG call is sent to the wrong URL.

     

    And I've never seen a GEL SOAP call targeted at anything like endpoint="http://<OUR_SERVER>/axis/services/USD_R11_WebService"

     

    Only ever at;

    endpoint="http://<OUR_SERVER>/niku/xog"

    (or endpoint="internal" if running under the BG engine)

     

    - So forgive me if you you know what you are doing, but that /axis/services/USD_R11_WebService just "looks wrong"?



  • 4.  Re: Failed to send a SOAP message generated

    Posted May 15, 2018 10:19 AM

    /niku/xog is applicable when calling PPM's own web services, but the web services of other products can have entirely different URIs like the one showing.

     

    Check the XML namespaces from the request and you'll see this login is intended for a ServiceDesk system endpoint instead.

     

    So I expect it is valid, however PPM is a little uncommon in that it uses only the URI (and soap body) and not a SOAPAction header value for identifying the handler for the request.



  • 5.  Re: Failed to send a SOAP message generated

    Posted May 15, 2018 10:44 AM
    /niku/xog is applicable when calling PPM's own web services, but the web services of other products can have entirely different URIs like the one showing

    Ah yes see I did misunderstand the original question then!



  • 6.  Re: Failed to send a SOAP message generated

    Posted May 15, 2018 10:35 AM

    Thanks Nick for your fast reply.

     

    I found that SOAP UI is setting the SOAPAction: header with http://www.ca.com/UnicenterServicePlus/ServiceDesk/USD_WebServiceSoap/loginRequest .

     

    How do I declare it on my Gel Script? What is the correct syntax?

     

     



  • 7.  Re: Failed to send a SOAP message generated

    Posted May 15, 2018 12:06 PM

    I would like you to try changing the soap:invoke line in your script to this:

     

    <soap:invoke endpoint="http://<OUR_SERVER>/axis/services/USD_R11_WebService" var="auth" soapAction="http://www.ca.com/UnicenterServicePlus/ServiceDesk/USD_WebServiceSoap/loginRequest">

     

    Note that this value can change for each type of request you make (login, logout, other operations) and so the documentation for the web services you are calling should be able to tell you what it needs to be; if not, you can always consume the service in SoapUI again and check what it thinks it should be set to as a backup.  It does a decent interpretation of soap requirements.



  • 8.  Re: Failed to send a SOAP message generated
    Best Answer

    Posted May 16, 2018 02:10 PM

    Hi Nick / David ...I found the problem.

     

    The user name had the following: 

     

    <soapenv:Body>

    <ser:login>

    <username><DOMAIN\USERNAME></username>

    <password><PASSWORD</password>

    </ser:login>

    </soapenv:Body>

    </soapenv:Envelope>

     

    The DOMAIN in the username tag, gave an error in the gel script...so I remove it to test the WebService,

    but then SDM did not allow the login, that was gave the " failed to send a SOAP message error"

    I Changed the Gel Script to use parameters insted of a fixed value for the username and password, this way we can use the domain\username for the login:

     

    <soapenv:Body>

    <ser:login>

    <username>${usuarioNome}</username>

    <password>${senhaUsuario}</password>

    </ser:login>

    </soapenv:Body>

    </soapenv:Envelope>

     

    And also included the soapAction tag...

     

     

    So final working complete code is:

     

    <gel:script

    xmlns:core="jelly:core"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    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:xog="http://www.niku.com/xog"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

     

    <!-- Set username and password as parameters -->
    <gel:parameter default="svong" var="usuarioNome"/>
    <gel:parameter default="svong" secure="true" var="senhaUsuario"/>

     

     

    <soap:invoke endpoint="http://<OUR_SERVER>:8080/axis/services/USD_R11_WebService" var="auth" soapAction="http://www.ca.com/UnicenterServicePlus/ServiceDesk/USD_WebServiceSoap/loginRequest">

    <soap:message>


    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:login>

    <username>${usuarioNome}</username>
    <password>${senhaUsuario}</password>

    </ser:login>
    </soapenv:Body>
    </soapenv:Envelope>

     

     

    </soap:message>

    </soap:invoke>

     

    <!-- Get the sid from Login -->

    <gel:set asString="true" select="$auth/soapenv:Envelope/soapenv:Body/loginResponse/loginReturn" var="sessionID"/>

    <gel:log level="INFO">SID: ${sessionID} </gel:log>

    <gel:out>SID ${sessionID}!</gel:out>


    </gel:script>

     

    <!-- SID must be passed to other WebServices Calls : createRequest, etc-->

     

    <!-- Importante : Call WebService Logout passing the sid to end connection with SDM -->