matpj

GEL not logging into XOG through a process - but works by command line

Discussion created by matpj on Oct 12, 2010
Latest reply on Oct 12, 2010 by fpena
Hi all (again!)

I have written (with Dave's help) a GEL script that adds reosurces to project teams.
This works fine through the command line by just invoking XOG and using the parsed XML file.

When I try to put this in a Clarity Process to run as a job I have had to add parameters for username/password/URL

Using some of the FAQ snippets, I also included a section that logs in to XOG and returns a session ID.
Followed by a test to check for the presence of the session id.

The trouble is, it is not logging in - even though the supplied credentials are fine.
Here is the part of the code that it is using to log in.
My Process is returning the 'Couln't log into XOG' message that you can see towards the bottom.
Can anyone see anything fundamentally wrong with this?
I have checked the case of the variables to make sure they arent at fault.

Here are the parameters. I am using the same defaults in the process engine, and I know they are correct - if I hard-code them when running using the command line it works fine (although when I do it that way I dont bother getting the session id)
<gel:parameter var="XOGURL" default="http://nikuuat:8080"/>

<gel:parameter var="p_XOGUsername" default="arsxog"/>
<gel:parameter var="p_XOGPassword" default="arsxog1" secure="true"/>
<soap:invoke endpoint="${XOGURL}/niku/xog" var="auth">



<soap:message>




<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">





<soapenv:Header/>





<soapenv:Body>






<xog:Login>







<xog:Username>${p_XOGUsername}</xog:Username>







<xog:Password>${p_XOGPassword}</xog:Password>






</xog:Login>





</soapenv:Body>




</soapenv:Envelope>



</soap:message>


</soap:invoke>


<!-- Check whether a sessionID is returned.  If not, it means that Login was unsuccessful -->


<gel:set asString="true" select="$auth/soapenv:Envelope/soapenv:Body/xog:SessionID/text()" var="sessionID"/>


<core:choose>



<!-- Check XOG sessionID -->



<core:when test="${sessionID == null}">




<gel:out>[XOG]Couldn't Log in to XOG. Check the username/password and Application has started.</gel:out>




<gel:log level="ERROR" category="XOG">Couldn't Log in to XOG. Check the username/password and Application has started.</gel:log>
I cannot see ANYTHING wrong with this, and I took it straight from the examples in the FAQ download.

This wouldnt be an issue with 7.5.3 would it? Has GEL (syntax) changed at all since then?

[color=#FD0623]Update:

if I forget all of the sessionID bit and just invoke XOG it works fine.
I used a bit of code from my testing with the command line and notice that my library declaration is 'soap-env' rather than 'soapenv'
Does this make a difference? Also, I am declaring the library at the top of the script rather than in the Invoke tag.[color]
<gel:script xmlns:core="jelly:core" 
xmlns:sql="jelly:sql" 
xmlns:util="jelly.util" 
xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" 
xmlns:define="jelly:define" 
xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xog="http://www.niku.com/xog">
<gel:parameter var="XOGURL" default="http://nikuuat:8080"/>

<gel:parameter var="p_XOGUsername" default="arsxog"/>
<gel:parameter var="p_XOGPassword" default="arsxog2" secure="true"/>



[...all the jiggery-pokery goes here...]

<gel:log> running XML.....</gel:log>
<soap:invoke endpoint="${XOGURL}/niku/xog" var="runresult">


<soap:message>



<soap-env:Envelope>




<soap-env:Body>





<xog:Login>






<xog:Username>${p_XOGUsername}</xog:Username>






<xog:Password>${p_XOGPassword}</xog:Password>





</xog:Login>





<gel:include select="$built_xml"/>




</soap-env:Body>



</soap-env:Envelope>


</soap:message>

</soap:invoke>

<gel:log>Done</gel:log>



</gel:script>
Thanks in advance,
Matt

Outcomes