webservice needs to get sessionid with 2 different URL’s

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf webservice needs to get sessionid with 2 different URL’s

  • Creator
    Topic
  • #54955
    Donna Bailey
    Participant

      Has anyone ever had to set up a webservice using the HTTP protocol to get a Session ID and then send that Session ID back in message with the data?  Vendor is telling me the URL is different for each process.  I have a script I’ve used on another interface, but didn’t need the Session ID.

      I’m on windows using CL 5.8..

      Any thoughts, suggestions, etc??

      Thanks,

      Donna

      Donna Bailey
      Tele: 315-729-3805
      dbailey@microstar.health
      Micro Star Inc.

    Viewing 8 reply threads
    • Author
      Replies
      • #83570
        Dustin Sayes
        Participant

          Does the session ID come back in an XML file?

          Hmm, and in that XML file, is the HL7 message also in the same XML file?

          I’ve never done this before, just thinking out loud..

        • #83571
          Donna Bailey
          Participant

            You know what…when I finally was able to get the sessionID..it’s coming back in xml….so now I’m trying to get the other piece working…and having issues with getting the data to them.

            But after I get that to work..I’m going to need a way to connect the 2 threads..1.thread that retrieves the session id.  2.  Thread that gets the session id info from thread 1 and sends that along to vendor with the result data…

            Lots of fun!!

            Any thoughts?

            Thanks,

            Donna

            Donna Bailey
            Tele: 315-729-3805
            dbailey@microstar.health
            Micro Star Inc.

          • #83572
            Mark Thompson
            Participant

              Donna,

              Our approach to something like this is to save the original message into metadata and chain threads together.  Use the first thread to get the Session ID and save it to metadata also.  Pull in the original message from metadata and add the Session ID as needed, then pass it on to your destination using another thread.  Tcl is definitely required.

              Tcl procs that read or update metadata from inside a translate make the whole process more straight-forward.

              - Mark Thompson
              HealthPartners

            • #83573
              Donna Bailey
              Participant

                I need to take the message and the session ID and send route it to another thread…how do I get these message handles to do that?  I was trying to use disposition OVER?  But now my message is “stuck” on the middle thread..

                Donna

                Donna Bailey
                Tele: 315-729-3805
                dbailey@microstar.health
                Micro Star Inc.

              • #83574
                David Barr
                Participant

                  We do something similar and run this code on the “middle” thread in the outbound TPS:

                  Code:

                             keylget args MSGID mh
                             msgmetaset $mh SOURCECONN $::HciConnName
                             lappend dispList “OVER $mh”

                • #83575
                  Elisha Gould
                  Participant

                    We use something based on the following for the reply handling to pass the original message on with the info in the USERDATA.

                    The below retries if it fails, or passes the message on if its ok. Please note it may have typos in it.

                    Code:

                    proc session_reply {args} {
                       global HciConnName
                       keylget args MODE       aMode
                       keylget args MSGID      aMsgId
                       keylget args CONTEXT    aContext
                       keylget args ARGS       aArg

                    .
                    .
                    .
                       if {[string equal $aMode run]} {
                           set myDispList {}
                           switch $aContext {
                               sms_ib_reply {
                                   set myFail 0
                    .
                    .
                    .
                                   if {(!$myFail) && [keylget args OBMSGID myObMsgId]} {
                                       set myMsgId [msgcopy $myObMsgId]
                                       msgmetaset $myMsgId DESTCONN {} SOURCECONN $HciConnName USERDATA $myUserData
                                       lappend myDispList “CONTINUE $myMsgId”
                                   } else {
                                       set myFail 1
                                   }
                                   if {!$myFail} {
                                       lappend myDispList “KILLREPLY $aMsgId”
                                   } else {
                                       lappend myDispList “KILL $aMsgId”
                                   }

                               }
                           }
                           return $myDispList
                       }
                    }

                  • #83576
                    Donna Bailey
                    Participant

                      Elisha,

                      Thank you for the information…it looks exactly what I need to do…Where do you put your proc?

                      Donna

                      Donna Bailey
                      Tele: 315-729-3805
                      dbailey@microstar.health
                      Micro Star Inc.

                    • #83577
                      Elisha Gould
                      Participant

                        This goes in the TPS Inbound Reply of the Outbound properties.

                        If you only need to get a new session id on startup or predefined intervals, you could also save the session id somewhere, then use the TPS Outbound Data (sms_ob_data) to check if the session id is ok, then use OVER as per David’s message. I believe this skips the call to get the session id.

                      • #83578
                        Donna Bailey
                        Participant

                          Session ID gets reset about every hour…I couldn’t get the chaining of threads to work..so I went with outputting a file and then will pick it up with fileset-local to send data to vendor….in a crunch..so have to go with what I know…

                          Thanks all for you input.

                          Donna

                          Donna Bailey
                          Tele: 315-729-3805
                          dbailey@microstar.health
                          Micro Star Inc.

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