Clarity

 View Only
  • 1.  XOG SOAP Error Writing Timesheet Entry

    Posted May 08, 2017 11:34 AM

    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?



  • 2.  Re: XOG SOAP Error Writing Timesheet Entry

    Posted May 08, 2017 12:02 PM

    Is the <Header> line missing the object action?

     

    i.e. should it look like this;

    <Header version="6.0.11" action="write" objectType="timeperiod" externalSource="NIKU"/>



  • 3.  Re: XOG SOAP Error Writing Timesheet Entry

    Posted May 08, 2017 12:21 PM

    Hi David,

     

    I tried with that header and got the same error.  When I use SOAP on the Object API, I wrap the XOG request in a SOAP envelope that includes the <obj:WriteTimeperiod> tag, which means I don't necessarily have to specify the action or objectType in the Header.

     

    On a side note, how do you insert a code block in a post?  That would make the request payload a lot easier to read.