2 Replies Latest reply on Feb 15, 2019 5:47 AM by MunKeong Lee

    Session handling

    Hue Xavier
      Share:|

      Hi,

      For a new Folder we are trying to use, for the first time, a webservice job.

      We got 2 SOAP webservice, one for authentification and one for our real treatment.

       

      The problem is the following, We need to keep the authentification beetween the two job by keeping an http session between the 2 job.

       

      Is there a way to do that ? I see a way to active cookie in the configuration manager but it didn't seen to do anything.

       

      Alternativly i thiink of getting the session information from the cookie of the first webservice response and inject it in the header of the second webservice.

       

      Do you know of a solution ?

        • 1. Re: Session handling

          Hi Hue Xavier

           

          when you athenticate you get back the authentication token and it is valid over 20 mins. All you need to do extract it from "response", save it an keep it on a VARIABLE for reusing.

           

          response_register XML example

          The following example describes a successful response:

          <?xml version="1.0" encoding="iso-8859-1"?>

          <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

          <SOAP-ENV:Body>

          <ctmem:response_register xmlns:ctmem="http://www.bmc.com/ctmem/schema918">

          <ctmem:status>OK</ctmem:status>

          <ctmem:user_token>115B95A7FA4B787B924A2BEA8CE3121A</ctmem:user_token>

          <ctmem:authentication_message/>

          </ctmem:response_register>

          </SOAP-ENV:Body>

          </SOAP-ENV:Envelope>

           

          ---------------------

           

          Request to create SMART Folder and sub folder example

          The following example is request is to create a outer-most SMART Folder with a job and a sub folder in the first level which also contains a job:

          <?xml version="1.0" encoding="iso-8859-1"?>

          <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

          <SOAP-ENV:Body>

          <ctmem:request_def_create_folder xmlns:ctmem="http://www.bmc.com/ctmem/schema918">

          <ctmem:user_token>115B95A7FA4B787B924A2BEA8CE3121A</ctmem:user_token>

          <ctmem:SMART_folder>

          <ctmem:control_m>my918</ctmem:control_m>

          <ctmem:folder_name>apiTestSMARTFolder</ctmem:folder_name>

          <ctmem:order_method>SYSTEM</ctmem:order_method>

          <ctmem:folder_attributes>

          <ctmem:application>apiWinApp</ctmem:application>

          <ctmem:sub_application>apiGroup</ctmem:sub_application>

          <ctmem:created_by>emuser</ctmem:created_by>

           

          Rgds

           

          A>Gomes

          2 of 2 people found this helpful
          • 2. Re: Session handling
            MunKeong Lee

            Hi Hue

            Correct me if I'm wrong but it looks like your query is related to web services jobs rather than the EM API as suggested by Adriano. If so, I suggest that you create an Application Integrator (AI) job based on Web Service instead of creating a Web Service job. I'm not sure exactly how authentication works in your scenario and whether you need to extract a token for subsequent request. You can have multiple steps in a single AI job. The first step can be a login request. You can also extract the response (e.g. a token) and use it for the next step by saving it to a run-time parameter. The second step can make use of the the run-time parameter e.g. by injecting it into the header or as an input parameter to the second web service call.

            Give AI a go and let me know if it works for you.

            Regards,

            MK

            2 of 2 people found this helpful