JSON bounceJSON.tcl from inbound TPS

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf JSON bounceJSON.tcl from inbound TPS

  • Creator
    Topic
  • #55311
    Dennis Pfeifer
    Participant

      Ok,

      Feeling a little sheepish in that I can’t figure this out..

      Simple idea, given a JSON inbound server, send back a reply.

      The Inbound processing and going to Xlate etc. works fine, my problem is generating a reply from the inbound TPS.

      receiving error in log ..

      Call to “doReply” returned error string “BADDATA missing driver control which is required to process messages with ToCloverleafLink class”. Returning bad send to engine.

      snip of my inbound proc..

             run {

                 # ‘run’ mode always has a MSGID; fetch and process it

                 

                 keylget args MSGID mh

                 lappend dispList “CONTINUE $mh”

                 # get message data (json)

                 set jsonData [msgget $mh]

                 

                 # get the user data

                 set userData [msgmetaget $mh USERDATA]

                 # create outbound message

                 set obMsg [msgcreate -class protocol -recover -type reply]

                 set driverCtl [msgmetaget $mh DRIVERCTL]

                 msgmetaset $obMsg DRIVERCTL $driverCtl

                 # convert json data to tcl dict so that we may more easily access the data

                 set dictData [json::json2dict $jsonData]

      #

      #  Amazing suff with dictData happens here!

      #

      #  ## places results in $dictReply

      #

      msgappend $obMsg [json::dict2json $dictReply]

      lappend dispList “OVER $obMsg”

      }

      #

      # end of $mode switch statement..

      #

      #

      return $dispList

      I’ve looked at ws_samples and based code on bounceREST.tcl and bounceRaw.tcl

      Found this on clovertech, but wasn’t able to resolve using the ideas found here

      https://usspvlclovertch2.infor.com/viewtopic.php?t=7837&highlight=baddata+missing+driver+control

      enabled all engine output …

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–] msg: 0x0x7f7d7c071450

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgType           : REPLY

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgClass          : PROTOCOL

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgState          : OB post-SMS (11)

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgPriority       : 5120

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgRecoveryDbState: Log:update (3)

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgFlags          : 0x8002

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgMid            : [0.0.97]

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgSrcMid         : midNULL

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgSrcMidGroup    : midNULL

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgHostId         : 380022187

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgOrigSrcThread  : AmazingThread

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgOrigDestThread :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgSrcThread      : AmazingThread

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgDestThread     :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgXlateThread    :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgSkipXlate      : 0

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgSepChars       :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgNumRetries     : 0

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgGroupId        : 0

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgDriverControl  :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgRecordFormat   :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgRoutes         :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgUserData       :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgStaticIsDirty  : 0

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgVariableIsDirty: 0

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgRetryTimes     :

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgTimeStartIb    : 1487103088.977

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgTimeStartOb    : 1487103088.977

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgTimeCurQueStart: 0.000

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgTimeTotalQue   : 0.001

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgTimeRecovery   : 1487103088.977

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgEoConfig       : 0x(nil)

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     msgData (BO)      : 0x0x7f7d7c071610

      [pd  :thrd:DBUG/3:     AmazingThread:–/–/—- –:–:–]     message           : ‘{Like I said, something Amazing}’

      [msg :Msg :DBUG/0:     AmazingThread:02/14/2017 14:11:28] msgFree 0x0x7f7d7c071a50  refCnt 1

      [pd  :pdtd:INFO/0:     AmazingThread:02/14/2017 14:11:28] [0.0.97] Writing message to Protocol Driver java

      [pd  :pdtd:INFO/1:     AmazingThread:02/14/2017 14:11:28] [0.0.97] Writing message PARTIALLY complete

      [pd  :pdtd:INFO/1:     AmazingThread:02/14/2017 14:11:28] [0.0.97] Setup callback function for writing partial message

      [pti :sche:INFO/1:     AmazingThread:02/14/2017 14:11:28] Thread has 0 ready events left.

      [java:wrte:ERR /0:   AmazingThread_0:02/14/2017 14:11:28] Call to “doReply” returned error string “BADDATA missing driver control which is required to process messages with ToCloverleafLink class”. Returning bad send to engine.

      … game over … How about a nice game of chess?.  

      Thanks all!

      Dennis

    • The forum ‘Cloverleaf’ is closed to new topics and replies.