HTTP Protocol TPS – New Message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HTTP Protocol TPS – New Message

  • Creator
    Topic
  • #48449
    Barry Sheesley
    Participant

      I am using the HTTP Protocol for an outbound thread and I’ve created a Query TPS that uses TclCurl to communicate with a web service. I am receiving XML data back from the web service and would like to create a new message with this XML and send it as an inbound message to the same thread (or even a new thread would be OK). I’ve tried creating a new message and using SEND or CONTINUE but I never see it coming in as inbound.  I also used MSGCOPY and MSGSET to copy and change the original message but with the same results. It’s possible that I need to change some of the metadata but this is the first time I’ve ever tried this so I’m not sure. Does anyone know how I can get this data back through an inbound thread?

      Thanks.

    Viewing 3 reply threads
    • Author
      Replies
      • #58662
        Charlie Bursell
        Participant

          I’m not sure how you have this set up, but if you are using SEND you will probably have to set the SKIP Xlate flag or the engine thinks it needs to go through Xlate.  Something like:

          msgmetaset $mh SKIPXLT 1

          Also, don’t forget to set DESTCONN

        • #58663
          Barry Sheesley
          Participant

            Charlie, Thanks for the tips.  I set the SKIPXLT to 1 and set the DESTCONN to the same thread name as I’m using for the outbound message.  Even though I use the SEND disposition for the new message, I never see it appear as an inbound message. Here is the message dump for the new message.  See any obvious problems?  Since this message is created in the Driver Control TPS, will it still SEND the new message back into the same thread?

            msg: 0x0083C540

               msgType           : DATA

               msgClass          : PROTOCOL

               msgState          : Unknown: 0 (0)

               msgPriority       : 5122

               msgRecoveryDbState: 2

               msgFlags          : 0x8002

               msgMid            : [0.0.2808318]

               msgSrcMid         : [0.0.2808241]

               msgSrcMidGroup    : midNULL

               msgOrigSrcThread  : hcs_test_hl7

               msgOrigDestThread : CaretrackerQuery_Test_XML

               msgSrcThread      : CaretrackerQuery_Test_XML

               msgDestThread     : CaretrackerQuery_Test_XML

               msgXlateThread    :

               msgSkipXlate      : 1

               msgSepChars       :

               msgNumRetries     : 0

               msgGroupId        : 0

               msgDriverControl  :

               msgRecordFormat   :

               msgRoutes         :

               msgUserData       :

               msgStaticIsDirty  : 1

               msgVariableIsDirty: 1

               msgTimeStartIb    : 1144243771.968

               msgTimeStartOb    : 1144243772.265

               msgTimeCurQueStart: 0.000

               msgTimeTotalQue   : 0.000

               msgTimeRecovery   : 1144243773.890

               msgEoConfig       : 0x00000000

               msgData (BO)      : 0x0083C5EC

               message           : My message data

          • #58664
            Charlie Bursell
            Participant

              By Driver Control TPS do you mean a UPoC protocol?  If so, I don’t think you can SEND from there.  Also, I note that the msgDestThread is the same as msgSrcThread.  You have to set the proper destination.

              Since it’s hard for me to figure out what you are trying to do, it’s also hard to offer suggestions.  If you are using the httpQuery proc, or a derivitive of it, change the returned message to a RELPY type and deal with it in a reply proc.  It will make life much easier.

              Look for: set outMsg [msgcreate -recover -type data $body]

              Change to: set outMsg [msgcreate -recover -type reply $body]

              IMHO, thta is the way the proc should have been written anyway.

              Good luck with it.

              Charlie

            • #58665
              Barry Sheesley
              Participant

                I finally got this to work using the following:

                Created a new message using the following:

                set newmsg [msgcreate -recover -class protocol -type data $httpBody]

                msgmetaset $newmsg DESTCONN $HciConnName PRIORITY 5120 SOURCECONN $HciConnName

                I then used the OVER disposition to send this message back to the inbound queue of this thread:

                lappend dispList “OVER $newmsg”

                This seems to work OK.  Thanks for the assistance!

            Viewing 3 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.