AnsweredAssumed Answered

XOG SOAP Error Writing Timesheet Entry

Question asked by irtiza.rizvi on May 8, 2017
Latest reply on May 8, 2017 by irtiza.rizvi

Hello,

 

I am trying to write a timesheet entry using the Object API, following the instructions in the CA PPM integration guide.  Here is the SOAP information:

 

Endpoint: https://cppminstance.ondemand.ca.com/niku/xog

Action: WriteTimeperiod

Request:

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:obj="http://www.niku.com/xog/Object">
<soapenv:Header>
<obj:Auth>
<obj:Username>username</obj:Username>
<obj:Password>password</obj:Password>
</obj:Auth>
</soapenv:Header>
<soapenv:Body>
<obj:WriteTimeperiod>
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_timeperiod.xsd">
<Header version="6.0.11" externalSource="NIKU"/>
<TimePeriods>
<TimePeriod finish="2017-05-12T00:00:00" start="2017-05-05T00:00:00">
<TimeSheets>
<TimeSheet ID="-1" resourceID="kbleiche" action="add" version="1" status="0">
<TimeSheetEntries>
<TimeSheetEntry projectID="PR-003028" internalTaskID="5004007">
<DailyActuals>
<Actual actualDate="2017-05-08" amount="12"/>
</DailyActuals>
</TimeSheetEntry>
</TimeSheetEntries>
<Notes>
<NoteData noteText="test CA PPM log" createdBy="kbleiche" createdTime="2017-05-08T02:58:00" category="NoteCat"/>
</Notes>
</TimeSheet>
</TimeSheets>
</TimePeriod>
</TimePeriods>
</NikuDataBus>
</obj:WriteTimeperiod>
</soapenv:Body>
</soapenv:Envelope>

 

This specific example involves creating a new timesheet for the given resourceID and time period, but I also have to handle situations where I am adding/editing an existing timesheet too.  The error I get is:

 

Problem In Imported Data: Import cancelled.

com.niku.xql2.InvalidXQLObjectException: Unable to update record
at com.niku.xql2.jdbc.JDBCRecord.update(JDBCRecord.java:490)
at com.niku.xql2.handlers.UpdateHandler.postProcess(UpdateHandler.java:103)
at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1419)
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.traverse(DOMWalker.java:51)
at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:388)
at com.niku.xql2.handlers.LoopHandler.processSet(LoopHandler.java:259)
at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:216)
at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1385)

...

 

What is the resolution to this error message?

Outcomes