AnsweredAssumed Answered

com.niku.xog.XOGException: Empty SOAP Request

Question asked by PragyaT on Oct 13, 2011
Latest reply on Oct 13, 2011 by PragyaT
Hi,

I'm new to gel scripts and xog.
There was a requirement from our client to import data from excel to clarity database using xog.
I was able to write a gel script for that and the data was imported successfully.
But now they want us to create a xog file so that they can run it in xog.client from the clarity front end.

I wrote the gel script in a soap message and tried to run it in xog.client.
But i got below error message:

<?xml version="1.0" encoding="UTF-8"?>
<XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
<Object type="unknown"/>
<Status state="FAILURE"/>
<Statistics failureRecords="0" insertedRecords="0"
totalNumberOfRecords="0" updatedRecords="0"/>
<ErrorInformation>
<Severity>FATAL</Severity>
<Description>Exception while processing client request</Description>
<Exception type="com.niku.xog.XOGException"><![CDATA[
com.niku.xog.XOGException: Empty SOAP Request

at com.niku.xog.util.ObjectRequestContext.extractInfo(ObjectRequestContext.java:148)

at com.niku.xog.util.ObjectRequestContext.<init>(ObjectRequestContext.java:127)

at com.niku.xog.handler.XOGProcessHandler.postProcess(XOGProcessHandler.java:43)

at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1355)

at com.niku.union.xml.dom.DOMWalker.postProcess(DOMWalker.java:210)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:94)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:36)

at com.niku.xql2.XQLProcessor.process(XQLProcessor.java:239)

at com.niku.xql2.XQLProcessor.process(XQLProcessor.java:280)

at com.niku.xql2.binding.ServiceControlBindingXql.processFile(ServiceControlBindingXql.java:393)

at com.niku.xql2.binding.ServiceControlBindingXql.getDocument(ServiceControlBindingXql.java:258)

at com.niku.xql2.binding.ServiceControlBindingXql.processRequest(ServiceControlBindingXql.java:142)

at com.niku.union.service.ServiceControlImpl.processRequest(ServiceControlImpl.java:759)

at com.niku.union.service.ServiceControlImpl.processRequest(ServiceControlImpl.java:213)

at com.niku.union.web.WebServiceAdapter.processRequest(WebServiceAdapter.java:195)

at com.niku.union.web.PortletController.processServiceRequest(PortletController.java:1341)

at com.niku.union.web.PortletController.processAuthorizedPortlet(PortletController.java:861)

at com.niku.union.web.PortletController.processPageActionRequest(PortletController.java:381)

at com.niku.union.web.PortletController.processRequest(PortletController.java:160)

at com.niku.union.web.WebActionController.processAction(WebActionController.java:1090)

at com.niku.union.web.WebActionController.processRequest(WebActionController.java:170)

at com.niku.union.web.WebControlServlet.service(WebControlServlet.java:319)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at com.niku.union.web.filter.GZIPResponseFilter.doFilter(GZIPResponseFilter.java:121)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at com.niku.union.web.filter.CharsetFilter.doFilter(CharsetFilter.java:29)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

at java.lang.Thread.run(Thread.java:595)
]]></Exception>
</ErrorInformation>
</XOGOutput>


Is there any workaround?

Below is my xml:

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

xmlns:sql="jelly:sql"

xmlns:xog="http://allscripts-qa.axisgroup.com/niku/xog"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:cats="jelly:com.clarity.CATS.customtag.CATSTagLibrary"

xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"

xmlns:u="jelly:util">

<gel:parameter default="http://allscripts-qa.axisgroup.com/niku/xog" var="XOGURL"/>
<gel:parameter default="svong" var="XOGUsername"/>
<gel:parameter default="svong" secure="true" var="XOGPassword"/>


<!-- Log into XOG and get a session ID -->
<soap:invoke endpoint="${XOGURL}/niku/xog" var="auth">
<soap:message>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xog="http://allscripts-qa.axisgroup.com/niku/xog">
<soapenv:Header/>
<soapenv:Body>
<xog:Login>
<xog:Username>${XOGUsername}</xog:Username>
<xog:Password>${XOGPassword}</xog:Password>
</xog:Login>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>

<!-- Checking whether a sessionID is returned. If not, it means that Login was unsuccessful -->
<gel:set asString="true" select="$auth/SOAP-ENV:Envelope/SOAP-ENV:Body/xog:SessionID/text()" var="sessionID"/>
<core:choose>
<core:when test="${sessionID == null}">
<gel:out>Couldn't Log in. Check the username/password.</gel:out>
</core:when>
<core:otherwise></core:otherwise>
</core:choose>

<!--Run XOG and attach an input file...alternatively the Body section can be the NikuDatabus section of an input file-->
<soap:invoke endpoint="${XOGURL}/niku/xog" var="runresult">
<soap:message>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xog="http://allscripts-qa.axisgroup.com/niku/xog">
<soapenv:Header>
<xog:Auth>
<xog:SessionID>${sessionID}</xog:SessionID>
</xog:Auth>
</soapenv:Header>
<soapenv:Body>
<core:set var="DB_Server_Name_or_IP" value="206.188.13.38" />
<core:set var="DB_Database_Name" value="eclipsys_qa"/>
<core:set var="DB_user" value="skatiyar" />
<core:set var="DB_password" value="sbsEl543" />

<core:set var="Clarity_DB" value="jdbc:sqlserver://${DB_Server_Name_or_IP}:1433;databaseName=${DB_Database_Name};user=${DB_user};password=${DB_password};"/>
<sql:setDataSource url="${Clarity_DB}" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" var="ClarityDS"/>


<file:readFile delimiter="," embedded="false" fileName="C:\My Docs\2012 PTO and FH Hours.csv" var="input"/>



<!--<sql:query var="SDD_Instance">SELECT * FROM [${worksheet}$$]</sql:query>-->

<core:forEach trim="false" begin="1" items="${input.rows}" step="1" var="instanceSDD" indexVar="i">
<core:choose>

<sql:update escapeText="false" dataSource="${ClarityDS}" >
Update odf_ca_resource
set
pto_2012 = ${instanceSDD[3]},
fltg_hlday_2012 = ${instanceSDD[4]}
where
id = (select id from srm_resources where unique_name = '${instanceSDD[2]}')
</sql:update>

</core:choose>
</core:forEach>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>


<!-- Read the output and extract some information from it -->
<gel:set asString="true" select="$runresult/SOAP-ENV:Envelope/SOAP-ENV:Body/NikuDataBus/XOGOutput/Status/@state"
var="XOGoutcome"/>
<core:switch on="${XOGoutcome}">
<core:case value="SUCCESS">



<gel:set asString="false" select="$runresult/SOAP-ENV:Envelope/SOAP-ENV:Body/NikuDataBus/XOGOutput/Statistics" var="stats"/>
<gel:out>
Success!
</gel:out>
</core:case>
<core:case value="FAILURE">

<gel:out>
XOG failed.
</gel:out>
</core:case>
<core:default>
<gel:out>Couldn't find XOG output summary. Please check the output file manually.</gel:out>
</core:default>
</core:switch>


<!-- Log out of the XOG -->
<soap:invoke endpoint="${XOGURL}/niku/xog" var="logoutresult">
<soap:message>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xog="http://allscripts-qa.axisgroup.com/niku/xog">
<soapenv:Header>
<xog:Auth>
<xog:SessionID>${sessionID}</xog:SessionID>
</xog:Auth>
</soapenv:Header>
<soapenv:Body>


<xog:Logout/>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>

</gel:script>


Please help me correct the issues.

Outcomes