Clarity

  • 1.  XOG Idea Read:  Unexpected Character Literal

    Posted Feb 01, 2018 04:44 PM

    Good Afternoon Community,

    A fellow developer and I are working on a process to integrate data from one system into CA PPM and back again (two way communication) via SOAP protocols.

    At this time we are working on a simple read to ensure we have connectivity, after this test we will look to call a WSDL created from an NSQL Query.  However, we are getting an error even on this basic read.  The xml looks like this:

    <soap:Envelope xmlns:tns="http://www.niku.com/xog/Object" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Header>
          <tns:Auth><tns:SessionID>[sessionid]</tns:SessionID></tns:Auth>
       </soap:Header>
       <soap:Body>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
      <Header version="6.0.13" action="read" objectType="idea" externalSource="NIKU">
        <args name="include_resources" value="true"/>
        <args name="include_tasks" value="true"/>
        <args name="include_allocations" value="true"/>
      </Header>
      <Query>
        <Filter name="objectID" criteria="EQUALS">[Identifier]</Filter>
      </Query>
    </NikuDataBus>
       </soap:Body>
    </soap:Envelope>

    please note that identifier is the value from the table.column : inv_investments.code and is a string value

    The error we are being returned is:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Header/>
          <soapenv:Body>
          <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
             <Object type="idea"/>
             <Status elapsedTime="0.001 seconds" state="FAILURE"/>
             <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/>
             <ErrorInformation>
                <Severity>FATAL</Severity>
                <Description>[Error] :1:1: unexpected character literal</Description>
                <Exception type="java.lang.Exception">Invalid xml data</Exception>
             </ErrorInformation>
          </XOGOutput>
       </soapenv:Body>
    </soapenv:Envelope>

    We have been unable to identify the unexpected character literal.  We do not see (in the code) any of the Usual suspects (' ', <, >, &). 

    We would appreciate any help and guidance you can provide.

    Thank you.



  • 2.  Re: XOG Idea Read:  Unexpected Character Literal
    Best Answer

    Posted Feb 02, 2018 02:38 AM

    A couple of things you can check are:

    * XOG Out just one Idea using the XOG Client. See if that works

    * Log the output of SQL that is fetching the "code", and see if that is as expected

    * Log the code again just before it is passed as filter, and see if it is still as expected

     

    Also, looks like you are using version="6.0.13", change that to version="8.0" and try.



  • 3.  Re: XOG Idea Read:  Unexpected Character Literal

    Posted Feb 02, 2018 03:26 AM

    Yes, start with getting the read working with XOG client.

    When you say

    We have been unable to identify the unexpected character literal.  We do not see (in the code) any of the Usual suspects (' ', <, >, &). 

    does is mean that in the real input you do not have those square brackets in

       <Filter name="objectID" criteria="EQUALS">[Identifier]</Filter>

    That should be the idea ID/Code you see in the GUI.



  • 4.  Re: XOG Idea Read:  Unexpected Character Literal

    Posted Feb 02, 2018 09:58 AM

    The simplest way to test both the object and query wsdl is to use SOAPUI.

     

    Download it. Create a new soap project by pointing it to the wsdl.  I will then create new request that you can just paste in the xml to see if it works.

     

    Check to see that you don't have a Byte Order Mark (BOM) at the begining.  That is an issue I see generate this error message.

     

    V/r,

    Gene