11 Replies Latest reply on Jan 30, 2018 4:55 PM by Carl Wilson

    Regarding SB : REST Connector : Extract cookie output

    Sanket Mhatre

      Hi Team,

       

      I am trying to connect SB workflow with the the SB system itself using REST Connector. Basically what we are trying is, in SB questionnaire we have a field remedy login id , if user add a login id, then; we want to get this user automatically added in SB virtual market place.

       

      This is only possible using REST call (SB End point URL) as of now. Hence what we thought it to use SB workflow, to perform this operation.

       

      Logically, against SB, we need to get the authentication cookie , such that we can perform Add/remove user from virtual marketplace REST call. However, in reality the output of HTTP call against SB got more data along with the specific cookie. Out of that, we need only cookie information, since in SB we can't perform string operations. But somehow, I need this cookie information.

       

      I tried to use session as a output :

      However it give output as :

       

      I can't extract cookie out of this whole information, and use it in the subsequent REST call towards SB iteself.

       

      Then i tried to map 'cookie' of the output as below :

       

      However that resulted into below error :

      com.bmc.myservice.common.util.exception.MyServiceException: [ERROR (941): The property in the expression could not be resolved to a value.] at com.bmc.myservice.common.util.exception.MyServiceExceptionUtils.rethrowRxException(MyServiceExceptionUtils.java:39) at com.bmc.myservice.common.util.SrvInterceptor.invoke(SrvInterceptor.java:32) at com.sun.proxy.$Proxy246.startProcessInstance(Unknown Source) at ...........

       

       

      Any idea how to extract this cookie returned by SB iteself?

       

      Carl Wilson any idea ? There is very less material on SB REST.  Does it look like a defect since I can't map cookie or any other thoughts.

       

      PS : I understand , we can give asset manager SB role, and that role can do this operations . but we want to try out some SB stuff.

       

      Thanks,

      Sanket

        • 1. Re: Regarding SB : REST Connector : Extract cookie output
          Carl Wilson

          Hi,

          I have not used the inbuilt SB Rest functions, I did all of my Rest programming externally using other tools where I could extract the "Set-Cookie" contents and add to the connection properties as an additional parameter.

           

          I did create a program that used a ITSM permission group (where you add a specific permission to the user) to map people into a VM, but this was done with AO not via SB itself - where AO talked to both systems to push the data between.

           

          As you are finding, there are limitations on what you can do on output variables i.e. string manipulation, etc, within SB itself.

           

          The Rest API is not heavily documented, this is due to BMC changing the Rest calls between different versions of SB as the platform changes.

           

          Cheers

          Carl

          1 of 1 people found this helpful
          • 2. Re: Regarding SB : REST Connector : Extract cookie output
            Hugh Fairfield

            Hi Sanket,

             

            The important thing to add is the X-Requested-By header (can be anything) and the default-bundle-scope header (needs to be 'myit-sb') to the headers of the post.

            The workflow would go as follows:

            1. Call login endpoint via a 'Send HTTP Request' call
            2. Create a new Input Set. The item that should go to input set 1 is the response headers from the login call. Add the X-Requested-By and default-bundle-scope headers to the input set
            3. Set up the post call as a 'Send HTTP Request' call. Add the Session from the login response call and the input set inputs from step 2.

             

            When you make the posts from within the process, they will work.

             

            Cheers,

             

            Hugh

            1 of 1 people found this helpful
            • 4. Re: Regarding SB : REST Connector : Extract cookie output
              Sanket Mhatre

              Hi Carl,

               

              Is it possible for you to guide us in one of the issue. Basically, using BAO HTTP adapter , we  are initiating request towards SB for adding user in entitlement using REST call.

               

              However that ends up in error response from service broker. ERROR (149): A user name must be supplied in the control record.

               

              Steps :

              1. Using BAO HTTP adapter authenticate the session against Service broker (working as expected)

              2. Now use the cookie in HTTP adapter POST for adding user to virtual Market place

               

              If I enter, the XML input details (visible in BAO process log)  in REST clients (basically header), then it does works.. But same details doesn't work in BAO HTTP adapter. FYI.. in below request i have masked few of the details as XXXX ..

               

              Can you please help , what could be an issue?, we spent almost weekend, but we couldn't make it work. Or any hints.. how & where to get complete REST call (not XML) generated by BAO HTTP adapter towards SB?

               

              Process Log from BAO Studio as below :

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

              21 Jan 2018 21:47:08,266 [Current Time=Sun Jan 21 21:47:08 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142] [Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142/:XXXX:ManageVirtualMarketplace:start:call-process[1]]

              [adapter request=

              <request-data>

                <http-adapter-request>

                  <http-connection-properties>

                    <Content-Type>application/json</Content-Type>

                    <default-bundle-scope>myit-sb</default-bundle-scope>

                    <X-Requested-By>XXX@XXX</X-Requested-By>

                    <Authentication-Token>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJaQ2U4Z1Rwc0xYSDY2TUlyRVI5OTdBUzJzTTBcL3lJTDlzZnJ0XC9DaEZqR1FScWN0WktGT0lNazFBbTNMM1BWTGlSWlhLcmhPOXRSaEg4enQ3aDRoNFQ3bmJZTGNGcXk1bHpDOTd6Tis1WmFLclwvWkFyNHAwM2RnPT0iLCJuYmYiOjE1MTY1Njc0NjIsIl9wYXNzd29yZCI6IjVmWjVvMGQ4UTcrSWdycm1neDZMREtpWkxFZEJRcXV3cjdLWlVSM2tGOEVmcVBCQTVORTdET3R5enl1VGF2aVpJbUY3R2pOXC9yS0hcL2NJTlgzS0dLUGxaV2hpTm1SXC9JeXhuaHFtQ2grVGFDb2k1Zk9qZ0tBMnc9PSIsIl9pbXBlcnNvbmF0ZWRVc2VyIjpudWxsLCJpc3MiOiJzZXNzZXJpMDI3NTIuc3Muc3cuZXJpY3Nzb24uc2UiLCJfYXV0aFN0cmluZyI6IklPQURzZkVcL0pRWmVlazlLYnJkTnA5aGlVZzFrcEdkcVpaRkhqOVBNVlRmRmorM3NQemhrcWJ1SkRYSXJINCtDQ21ld3E1TXpaVlBTNGtMQTBWU1RrM2djQWZHaUtqa2FSWlcxZ0xna1BURlVBVlpVZk1iUzBnPT0iLCJfY2FjaGVJZCI6MjA2NTIyNSwiZXhwIjoxNTE2NTcxMTgyLCJpYXQiOjE1MTY1Njc1ODIsImp0aSI6IklER0FBRldJSFJSU1NBUENYMUIwUENBVk1HNEIyNSIsIl9hYnNvbHV0ZUV4cGlyYXRpb25UaW1lIjoxNTE2NjUzOTgyfQ.9_7VjKEmZjAjV3IpHCNqCP2YB7ipv_6V1xB6i1Hknls</Authentication-Token>

                  </http-connection-properties>

                  <action>http://XXXXXXXX:8008/api/myit-sb/virtualmarketplaces/1201/users</action>

                  <use-ssl-certificate>false</use-ssl-certificate>

                  <install-certificate>false</install-certificate>

                  <allow-unsigned-certificate>false</allow-unsigned-certificate>

                  <passphrase>****MASKED****</passphrase>

                  <ignore-line-break-in-response>true</ignore-line-break-in-response>

                  <file-content-type />

                  <data-format>xml</data-format>

                  <data>{"userIDs" : ["XXXXXX"]}</data>

                  <enable-json-conversion>false</enable-json-conversion>

                </http-adapter-request>

              </request-data>]

              21 Jan 2018 21:47:08,801 [Current Time=Sun Jan 21 21:47:08 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142] [Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142/:XXXXXXX:ManageVirtualMarketplace:start:call-process[1]]

              [TEXT=Adapter response]

              [adapter response=

              <httpAdapterResponse>

                <metadata>

                  <status>success</status>

                </metadata>

                <status-line>

                  <code>500</code>

                  <reason>Internal Server Error</reason>

                </status-line>

                <header-lines>

                  <Date>Sun, 21 Jan 2018 20:47:08 GMT</Date>

                  <X-Frame-Options>SAMEORIGIN</X-Frame-Options>

                  <Content-Type>application/json</Content-Type>

                  <Content-Length>187</Content-Length>

                </header-lines>

                <message-body>

                  <e>

                    <messageAppendedText>[ERROR (149): A user name must be supplied in the control record]</messageAppendedText>

                    <messageNumber>8790</messageNumber>

                    <messageText>Unknown system error</messageText>

                    <messageType>ERROR</messageType>

                    <moreInfo />

                  </e>

                </message-body>

              </httpAdapterResponse>]

              21 Jan 2018 21:47:08,809 [Current Time=Sun Jan 21 21:47:08 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142] [Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142/:XXX:ManageVirtualMarketplace:start:call-process[1]] [ProcessTermination=The process terminated in the completed state. The process started at 21 Jan 2018 21:47:08,227, terminated at 21 Jan 2018 21:47:08,807, and the execution took 580 milliseconds.]

              21 Jan 2018 21:47:08,813 [Current Time=Sun Jan 21 21:47:08 CET 2018] [Process Name=:XXXX:ManageVirtualMarketplace] [Root Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142] [Job Id=28773d0ffd4593a1:-6f6d05d4:1611a1f8c3c:-80001-1516567628142] [ProcessTermination=The process terminated in the completed state. The process started at 21 Jan 2018 21:47:08,218, terminated at 21 Jan 2018 21:47:08,812, and the execution took 594 milliseconds.]

               

               

              Thanks,

              Sanket

              • 5. Re: Regarding SB : REST Connector : Extract cookie output
                Carl Wilson

                Hi,

                the connection properties elements are slightly different in AO to what you would use in SB for the authentication token. 

                See below:

                 

                This is the XML connection properties to supply with the REST Api call through the HTTP Adapter with the Session Cookie added.

                 

                Example:

                 

                <http-connection-properties>

                <default-bundle-scope>rxn:/myit-sb</default-bundle-scope>

                <Content-Type>application/json</Content-Type>

                <Cookie>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhMktyTzZ......</Cookie>

                </http-connection-properties>

                 

                Cheers

                Carl

                • 6. Re: Regarding SB : REST Connector : Extract cookie output
                  Sanket Mhatre

                  Thanks a lot Carl for responding.. However , even with the same got similar error

                   

                   

                  DEBUG - Preparing to test the process.........

                  DEBUG - Starting Local Peers on the grid........

                  DEBUG - Started all local peers.

                  DEBUG - ---------------------------------------------------

                  DEBUG - -- About to Start WorkFlow Testing

                  DEBUG - ---------------------------------------------------

                  DEBUG - Process Details:

                  DEBUG - Grid Name: MyGrid

                  DEBUG - Module Name: XXXX_Automations

                  DEBUG - Process ID: :XXXX_Automations:ManageVirtualMarketplace

                  DEBUG - Launch Requested

                  22 Jan 2018 10:36:56,714 [Current Time=Mon Jan 22 10:36:56 CET 2018] [Process Name=:XXXX_Automations:ManageVirtualMarketplace] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [ProcessStart=The process started. It is triggered by the scheduler.]

                  22 Jan 2018 10:37:05,396 [Current Time=Mon Jan 22 10:37:05 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:XXXX_Automations:ManageVirtualMarketplace:start:call-process[1]]

                  [adapter request=

                  <request-data>

                    <http-adapter-request>

                      <http-connection-properties>

                        <Content-Type>application/json</Content-Type>

                        <default-bundle-scope>rxn:/myit-sb</default-bundle-scope>

                        <X-Requested-By>XXXX@XXXX.XX</X-Requested-By>

                        <Authentication-Token>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwbmRTODRab3FwdUlLY2hWWjRiNndzZitid3hGM0czNGdGb2N5NUt5OGROazB3TTVkSWhEd0lSRGJnNTk0czJpUkJFUENjUTBTNCthSG1mRU9LSzNETHNybHU0RkYwenVXVWoxRkpwOFRqYXdKT2haUGZwTjZRPT0iLCJuYmYiOjE1MTY2MTM1MzgsIl9wYXNzd29yZCI6IjAxSjMxU0taa0l0S1U1QUVZNkxraUNEc3BWNEdkXC9wdG84WFBUNG9tNzZ6Rm1LVGhKSjFrU2lcL0VzU05Ha2h3UjVWa0txK0N2UGFpY2t1Z0p4ZUd2akpRZ1dvQ1wvTHczU1VLYmtLb3lSbVNVYm9Wb0Z3a0VlRHc9PSIsIl9pbXBlcnNvbmF0ZWRVc2VyIjpudWxsLCJpc3MiOiJzZXNzZXJpMDI3NTIuc3Muc3cuZXJpY3Nzb24uc2UiLCJfYXV0aFN0cmluZyI6IkRpRitnQ3krQ3ZrOHh6S0Y0REczVW5MVHNIMzZGbVRMaHJ6NXJpZWgrTmlONFVmSFwvcml6SHd5Y0N5RXVmV1FKZ3BTTWZPdEtFQ28yQnFUT0J6MytIZGtNZ0d5VkxBMHl5b2Y5NExuS0VUc0VCM3dpZmRIZUh3PT0iLCJfY2FjaGVJZCI6MjA5MTU2MywiZXhwIjoxNTE2NjE3MjU4LCJpYXQiOjE1MTY2MTM2NTgsImp0aSI6IklER0FBRldJSFJSU1NBUENZMExHUENCVkdENUZMOSIsIl9hYnNvbHV0ZUV4cGlyYXRpb25UaW1lIjoxNTE2NzAwMDU4fQ.cakZ11R1Jkwsps8KcAWMDrcdLZNUJ61_x-MmJ-oQRlU</Authentication-Token>

                      </http-connection-properties>

                      <action>http://XXXX.XXX.se:8008/api/myit-sb/virtualmarketplaces/1201/users</action>

                      <use-ssl-certificate>false</use-ssl-certificate>

                      <install-certificate>false</install-certificate>

                      <allow-unsigned-certificate>false</allow-unsigned-certificate>

                      <passphrase>****MASKED****</passphrase>

                      <ignore-line-break-in-response>true</ignore-line-break-in-response>

                      <file-content-type />

                      <data-format>xml</data-format>

                      <data>{"userIDs" : ["XXX"]}</data>

                      <enable-json-conversion>false</enable-json-conversion>

                    </http-adapter-request>

                  </request-data>]

                  22 Jan 2018 10:37:06,665 [Current Time=Mon Jan 22 10:37:06 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:XXXX_Automations:ManageVirtualMarketplace:start:call-process[1]]

                  [TEXT=Adapter response]

                  [adapter response=

                  <httpAdapterResponse>

                    <metadata>

                      <status>success</status>

                    </metadata>

                    <status-line>

                      <code>500</code>

                      <reason>Internal Server Error</reason>

                    </status-line>

                    <header-lines>

                      <Date>Mon, 22 Jan 2018 09:37:06 GMT</Date>

                      <X-Frame-Options>SAMEORIGIN</X-Frame-Options>

                      <Content-Type>application/json</Content-Type>

                      <Content-Length>187</Content-Length>

                    </header-lines>

                    <message-body>

                      <e>

                        <messageAppendedText>[ERROR (149): A user name must be supplied in the control record]</messageAppendedText>

                        <messageNumber>8790</messageNumber>

                        <messageText>Unknown system error</messageText>

                        <messageType>ERROR</messageType>

                        <moreInfo />

                      </e>

                    </message-body>

                  </httpAdapterResponse>]

                  22 Jan 2018 10:37:06,699 [Current Time=Mon Jan 22 10:37:06 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:XXXX_Automations:ManageVirtualMarketplace:start:call-process[1]] [ProcessTermination=The process terminated in the completed state. The process started at 22 Jan 2018 10:37:04,039, terminated at 22 Jan 2018 10:37:06,696, and the execution took 2,657 milliseconds.]

                  22 Jan 2018 10:37:06,714 [Current Time=Mon Jan 22 10:37:06 CET 2018] [Process Name=:XXXX_Automations:ManageVirtualMarketplace] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [ProcessTermination=The process terminated in the completed state. The process started at 22 Jan 2018 10:36:56,717, terminated at 22 Jan 2018 10:37:06,712, and the execution took 9,995 milliseconds.]

                   

                                    DEBUG - Preparing to test the process......... DEBUG - Starting Local Peers on the grid........ DEBUG - Started all local peers. DEBUG - --------------------------------------------------- DEBUG - -- About to Start WorkFlow Testing DEBUG - --------------------------------------------------- DEBUG - Process Details: DEBUG - Grid Name: MyGrid DEBUG - Module Name: XXX_Automations DEBUG - Process ID: :XXX_Automations:ManageVirtualMarketplace DEBUG - Launch Requested 22 Jan 2018 10:36:56,714 [Current Time=Mon Jan 22 10:36:56 CET 2018] [Process    Name=:XXX_Automations:ManageVirtualMarketplace] [Root Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281]    [ProcessStart=The process started. It is triggered by the scheduler.] 

                  22 Jan 2018 10:37:05,396 [Current Time=Mon Jan 22 10:37:05 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:SMP_Automations:ManageVirtualMarketplace:start:call-process[1]]  [adapter request= <request-data>   <http-adapter-request>     <http-connection-properties>       <Content-Type>application/json</Content-Type>       <default-bundle-scope>rxn:/myit-sb</default-bundle-scope>       <X-Requested-By>erajanb@ericsson.se</X-Requested-By>       <Authentication-Token>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwbmRTODRab3FwdUlLY2hWWjRiNndzZitid3hGM0czNGdGb2N5NUt5OGROazB3TTVkSWhEd0lSRGJnNTk0czJpUkJFUENjUTBTNCthSG1mRU9LSzNETHNybHU0RkYwenVXVWoxRkpwOFRqYXdKT2haUGZwTjZRPT0iLCJuYmYiOjE1MTY2MTM1MzgsIl9wYXNzd29yZCI6IjAxSjMxU0taa0l0S1U1QUVZNkxraUNEc3BWNEdkXC9wdG84WFBUNG9tNzZ6Rm1LVGhKSjFrU2lcL0VzU05Ha2h3UjVWa0txK0N2UGFpY2t1Z0p4ZUd2akpRZ1dvQ1wvTHczU1VLYmtLb3lSbVNVYm9Wb0Z3a0VlRHc9PSIsIl9pbXBlcnNvbmF0ZWRVc2VyIjpudWxsLCJpc3MiOiJzZXNzZXJpMDI3NTIuc3Muc3cuZXJpY3Nzb24uc2UiLCJfYXV0aFN0cmluZyI6IkRpRitnQ3krQ3ZrOHh6S0Y0REczVW5MVHNIMzZGbVRMaHJ6NXJpZWgrTmlONFVmSFwvcml6SHd5Y0N5RXVmV1FKZ3BTTWZPdEtFQ28yQnFUT0J6MytIZGtNZ0d5VkxBMHl5b2Y5NExuS0VUc0VCM3dpZmRIZUh3PT0iLCJfY2FjaGVJZCI6MjA5MTU2MywiZXhwIjoxNTE2NjE3MjU4LCJpYXQiOjE1MTY2MTM2NTgsImp0aSI6IklER0FBRldJSFJSU1NBUENZMExHUENCVkdENUZMOSIsIl9hYnNvbHV0ZUV4cGlyYXRpb25UaW1lIjoxNTE2NzAwMDU4fQ.cakZ11R1Jkwsps8KcAWMDrcdLZNUJ61_x-MmJ-oQRlU</Authentication-Token>     </http-connection-properties>     <action>http://sesseri02752.ss.sw.ericsson.se:8008/api/myit-sb/virtualmarketplaces/1201/users</action>     <use-ssl-certificate>false</use-ssl-certificate>     <install-certificate>false</install-certificate>     <allow-unsigned-certificate>false</allow-unsigned-certificate>     <passphrase>****MASKED****</passphrase>     <ignore-line-break-in-response>true</ignore-line-break-in-response>     <file-content-type />     <data-format>xml</data-format>     <data>{"userIDs" : ["xkalgha"]}</data>     <enable-json-conversion>false</enable-json-conversion>   </http-adapter-request> </request-data>] 

                   

                  22 Jan 2018 10:37:06,665 [Current Time=Mon Jan 22 10:37:06 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:SMP_Automations:ManageVirtualMarketplace:start:call-process[1]]  [TEXT=Adapter response] [adapter response= <httpAdapterResponse>   <metadata>     <status>success</status>   </metadata>   <status-line>     <code>500</code>     <reason>Internal Server Error</reason>   </status-line>   <header-lines>     <Date>Mon, 22 Jan 2018 09:37:06 GMT</Date>     <X-Frame-Options>SAMEORIGIN</X-Frame-Options>     <Content-Type>application/json</Content-Type>     <Content-Length>187</Content-Length>   </header-lines>   <message-body>     <e>       <messageAppendedText>[ERROR (149): A user name must be supplied in the control record]</messageAppendedText>       <messageNumber>8790</messageNumber>       <messageText>Unknown system error</messageText>       <messageType>ERROR</messageType>       <moreInfo />     </e>   </message-body> </httpAdapterResponse>] 

                      22 Jan 2018 10:37:06,699 [Current Time=Mon Jan 22 10:37:06 CET 2018]    [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281/:XXX_Automations:ManageVirtualMarketplace:start:call-process[1]]    [ProcessTermination=The process terminated in the completed state. The    process started at 22 Jan 2018 10:37:04,039, terminated at 22 Jan 2018    10:37:06,696, and the execution took 2,657 milliseconds.] 22 Jan 2018 10:37:06,714 [Current Time=Mon Jan 22 10:37:06 CET 2018] [Process    Name=:XXX_Automations:ManageVirtualMarketplace] [Root Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281] [Job    Id=bcfad06ab23d00d3:-73edbd1e:1611d3a4580:-80001-1516613814281]    [ProcessTermination=The process terminated in the completed state. The    process started at 22 Jan 2018 10:36:56,717, terminated at 22 Jan 2018    10:37:06,712, and the execution took 9,995 milliseconds.] 

                  • 7. Re: Regarding SB : REST Connector : Extract cookie output
                    Carl Wilson

                    Hi,

                    Your request still seems to include the incorrect header information:

                     

                    <request-data>

                      <http-adapter-request>

                        <http-connection-properties>

                          <Content-Type>application/json</Content-Type>

                          <default-bundle-scope>rxn:/myit-sb</default-bundle-scope>

                          <X-Requested-By>XXXX@XXXX.XX</X-Requested-By>

                          <Authentication-Token>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwbmRTODRab3FwdUlLY2hWWjRiNndzZitid3hGM0czNGdGb2N5NUt5OGROazB3TTVkSWhEd0lSRGJnNTk0czJpUkJFUENjUTBTNCthSG1mRU9LSzNETHNybHU0RkYwenVXVWoxRkpwOFRqYXdKT2haUGZwTjZRPT0iLCJuYmYiOjE1MTY2MTM1MzgsIl9wYXNzd29yZCI6IjAxSjMxU0taa0l0S1U1QUVZNkxraUNEc3BWNEdkXC9wdG84WFBUNG9tNzZ6Rm1LVGhKSjFrU2lcL0VzU05Ha2h3UjVWa0txK0N2UGFpY2t1Z0p4ZUd2akpRZ1dvQ1wvTHczU1VLYmtLb3lSbVNVYm9Wb0Z3a0VlRHc9PSIsIl9pbXBlcnNvbmF0ZWRVc2VyIjpudWxsLCJpc3MiOiJzZXNzZXJpMDI3NTIuc3Muc3cuZXJpY3Nzb24uc2UiLCJfYXV0aFN0cmluZyI6IkRpRitnQ3krQ3ZrOHh6S0Y0REczVW5MVHNIMzZGbVRMaHJ6NXJpZWgrTmlONFVmSFwvcml6SHd5Y0N5RXVmV1FKZ3BTTWZPdEtFQ28yQnFUT0J6MytIZGtNZ0d5VkxBMHl5b2Y5NExuS0VUc0VCM3dpZmRIZUh3PT0iLCJfY2FjaGVJZCI6MjA5MTU2MywiZXhwIjoxNTE2NjE3MjU4LCJpYXQiOjE1MTY2MTM2NTgsImp0aSI6IklER0FBRldJSFJSU1NBUENZMExHUENCVkdENUZMOSIsIl9hYnNvbHV0ZUV4cGlyYXRpb25UaW1lIjoxNTE2NzAwMDU4fQ.cakZ11R1Jkwsps8KcAWMDrcdLZNUJ61_x-MmJ-oQRlU</Authentication-Token>

                        </http-connection-properties>

                        <action>http://XXXX.XXX.se:8008/api/myit-sb/virtualmarketplaces/1201/users</action>

                        <use-ssl-certificate>false</use-ssl-certificate>

                        <install-certificate>false</install-certificate>

                        <allow-unsigned-certificate>false</allow-unsigned-certificate>

                        <passphrase>****MASKED****</passphrase>

                        <ignore-line-break-in-response>true</ignore-line-break-in-response>

                        <file-content-type />

                        <data-format>xml</data-format>

                        <data>{"userIDs" : ["XXX"]}</data>

                        <enable-json-conversion>false</enable-json-conversion>

                      </http-adapter-request>

                    </request-data>]

                     

                    The Authentication Token needs to be wrapped in the correct element (<Cookie>), and I am not sure what the "<X-Requested-By>" element is doing in your connection properties.

                    Please try using the connection properties I supplied above.

                     

                    Cheers

                    Carl

                    1 of 1 people found this helpful
                    • 8. Re: Regarding SB : REST Connector : Extract cookie output
                      Sanket Mhatre

                      Hi Carl,

                       

                      Still we are struggling to make it work. I understand, I am requesting too much.. sorry for that...  we attempted as you suggested, but that ends up in bad request.. also we tried with REST adapter but that didn't helped.

                       

                      [adapter request=

                      <request-data>

                        <http-adapter-request>

                          <http-connection-properties>

                            <Content-Type>application/json</Content-Type>

                            <default-bundle-scope>rxn:/myit-sb</default-bundle-scope>

                            <Cookie>eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4eHVWXC9HRWJBRG1RN2p6aHJLb3lsWVNDXC92UkVpNGR0K1k2eUQrZ0FPXC8xcWZCNmhsRHc0Q05YSEZicTkwckQ4WkFjb1JTeEpSYmdcL0JlU3UyckVJb1ZKMkdEMUhJZmZqVGRJMnZPVUFvQ0kyVitKeStlQlVsQT09IiwibmJmIjoxNTE2NzM2MTYzLCJfcGFzc3dvcmQiOiJCN2djRFQzdmp5UDNoRW1KSGk2dFZBanJPNEZ5NVFoR1A2SWtkcnQra0tSeXh6VmVzQ09vM2dGTkJPNVRtTEhWcU5ydzdxaTQ5cXdFK1E1QmwwaWdUMmN1R3l3R0loalZ1alkrZnQxMnNDNHhqRjlTTHpvdWJRPT0iLCJfaW1wZXJzb25hdGVkVXNlciI6bnVsbCwiaXNzIjoic2Vzc2VyaTAyNzUyLnNzLnN3LmVyaWNzc29uLnNlIiwiX2F1dGhTdHJpbmciOiJkYnhzeEF2ZGxLOVdZcnYwV1V0TGs0RUkzVlpnVFc2UkEyUHNaZVNwSCsyaUd2MzFEUDJqWjhVbDNDSERRbU1MVklJSWE4WGwyVEp5M2p0ZjA5aUpPeHFQT2ROMWpRVFFqOFwvMVhoTnR2R3dLU3JUTTVpRFhGZz09IiwiX2NhY2hlSWQiOjIxNjE3ODksImV4cCI6MTUxNjczOTg4MywiaWF0IjoxNTE2NzM2MjgzLCJqdGkiOiJJREdBQUZXSUhSUlNTQVBEQVhINVBDRTdTMThGNVIiLCJfYWJzb2x1dGVFeHBpcmF0aW9uVGltZSI6MTUxNjgyMjY4M30.grIHTQHIi_ieWA1upA1QePXyoOe-FhxxHESowgyic4Y</Cookie>

                          </http-connection-properties>

                          <action>http://XXXX:8008/api/myit-sb/virtualmarketplaces/1201/users</action>

                          <use-ssl-certificate>false</use-ssl-certificate>

                          <install-certificate>false</install-certificate>

                          <allow-unsigned-certificate>false</allow-unsigned-certificate>

                          <passphrase>****MASKED****</passphrase>

                          <ignore-line-break-in-response>true</ignore-line-break-in-response>

                          <file-content-type />

                          <data-format>xml</data-format>

                          <data>{"userIDs" : ["XXXXXXX"]}</data>

                          <enable-json-conversion>false</enable-json-conversion>

                        </http-adapter-request>

                      </request-data>]

                      23 Jan 2018 20:39:38,301 [Current Time=Tue Jan 23 20:39:38 CET 2018] [Process Name=:AutoPilot-AD-Utilities:HTTP:Post] [Root Job Id=a1cb66c26dddbf1e:-72726868:16124761517:-80001-1516736377754] [Job Id=a1cb66c26dddbf1e:-72726868:16124761517:-80001-1516736377754/:XXXX_Automations:ManageVirtualMarketplace:start:call-process[1]]

                      [TEXT=Adapter response]

                      [adapter response=

                      <httpAdapterResponse>

                        <metadata>

                          <status>success</status>

                        </metadata>

                        <status-line>

                          <code>500</code>

                          <reason>Internal Server Error</reason>

                        </status-line>

                        <header-lines>

                          <Date>Tue, 23 Jan 2018 19:39:38 GMT</Date>

                          <X-Frame-Options>SAMEORIGIN</X-Frame-Options>

                          <Content-Type>application/json</Content-Type>

                          <Content-Length>142</Content-Length>

                        </header-lines>

                        <message-body>

                          <e>

                            <messageAppendedText>HTTP 400 Bad Request</messageAppendedText>

                            <messageNumber>8790</messageNumber>

                            <messageText>Unknown system error</messageText>

                            <messageType>ERROR</messageType>

                            <moreInfo />

                          </e>

                        </message-body>

                      </httpAdapterResponse>]

                      • 9. Re: Regarding SB : REST Connector : Extract cookie output
                        Carl Wilson

                        Hi,

                        looks like you are pushing json data into a XML based request, thus it throws a "bad request" error as it is not XML:

                         

                            <data-format>xml</data-format>

                            <data>{"userIDs" : ["XXXXXXX"]}</data>

                            <enable-json-conversion>false</enable-json-conversion>

                         

                        I normally leave the data-format null as it defaults to HTML on the HTML Adapter, so either leave it blank or set it to "html".

                         

                        Cheers

                        Carl

                        1 of 1 people found this helpful
                        • 10. Re: Regarding SB : REST Connector : Extract cookie output
                          Sanket Mhatre

                          Thanks Carl,

                           

                          Today is one of the best day of this week. Finally , we are able to crack the issue. Earlier we were using only cookie information, but then after carefully observing headers, we understood the difference. And thanks that wasn't possible without you.

                           

                          Now we are able to use HTTP adapter as well as REST adapter for this REST operations.

                           

                          May be I can close by bmc support case, to whom I just shared API+Filter+SQL logs from Service Broker. But I appreciate the BMC Support BAO guys too. One of the best people I have came across.

                           

                          Solution :

                          In the cookie field of the request use the value of Set-Cookie from response of authentication.

                          Cookie value in the request header should be similar to below , it's important to use version, path etc.. in the cookie field:

                          AR-JWT=eyJhbGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXulM;Version=1;Path=/api

                           

                          Thanks,

                          Sanket

                          • 11. Re: Regarding SB : REST Connector : Extract cookie output
                            Carl Wilson

                            Hi,

                            glad you got it sorted, and yes the BAO guys are one of the best support teams you will come across in BMC.

                             

                            Cheers

                            Carl