Session token generation using shell script? | Community
Skip to main content
Level 2
August 15, 2021
Solved

Session token generation using shell script?

  • August 15, 2021
  • 3 replies
  • 1663 views

Hi,

 

I have a requirement to trigger the tech wf's in ACC using a Control M, where i have to run a shell script to generate session token and postEvent(), so that the workflows gets triggered.

 

Via soap i am able to, but the main question is How can we generate session token and postEvent() using shell script?

If this is possible, please share the steps/script.

Thanks in advance!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kishore_Padamata

Hello @hari_07 
With Control M systems, I personally would suggest to use file-based.
Control M drops a 0byte file
ACC will match the filename pattern to start the workflow execution
ACC will drop another 0byte file to let Control M system on the successful completion.

Alternatively, if you wish to achieve by shell script:
As you do have SOAP based API calls, please refer to below screen grabs (using SOAP UI client)
After a successful API call is fired, the client will show all headers required to make an API call using curl, wget, etc.

 

Using the headers information from the SOAP UI client, a typical curl example:


Hope this helps!

3 replies

david--garcia
Level 10
August 16, 2021

I've done something similar but from windows powershell, I believe this falls outside of the acc support context. session token procedure still needs to be performed through soap regardless of source application/environment. (see a better explanation here - https://stackoverflow.com/questions/8800055/web-service-server-with-soap-on-linux)

 

The following link seems promising;

https://www.codeproject.com/Tips/1015753/Calling-SOAP-WebService-And-Parsing-The-Result-Fro

 

Once you figure out your shell script, please post the results here to help out the community.

 

Update**

Here is a sample of my script to invoke from windows powershell in case it may help someone.

 

## Set SOAP headers
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("charset", 'utf-8')
$headers.Add("SOAPAction", 'nms:rtEvent#PushEvent')
$url = "http://localhost:8080/nl/jsp/soaprouter.jsp"

$body = @"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nms:rtEvent">
<soapenv:Header/>
<soapenv:Body>
...rest of code here asd
</soapenv:Body>
</soapenv:Envelope>
"@
 Invoke-WebRequest -Method Post -Uri $url -Headers $headers -Body $body -ContentType 'application/xml'  

I used this with another cron job to monitor neolane web services crashing then this would trigger a transactional soap call to msg centre for a real time monitoring alert.

Kishore_Padamata
Adobe Employee
Kishore_PadamataAdobe EmployeeAccepted solution
Adobe Employee
August 25, 2021

Hello @hari_07 
With Control M systems, I personally would suggest to use file-based.
Control M drops a 0byte file
ACC will match the filename pattern to start the workflow execution
ACC will drop another 0byte file to let Control M system on the successful completion.

Alternatively, if you wish to achieve by shell script:
As you do have SOAP based API calls, please refer to below screen grabs (using SOAP UI client)
After a successful API call is fired, the client will show all headers required to make an API call using curl, wget, etc.

 

Using the headers information from the SOAP UI client, a typical curl example:


Hope this helps!

Sukrity_Wadhwa
Community Manager
Community Manager
September 9, 2021

Hi @hari_07,

Were you able to resolve this query with the help of @david--garcia's and/or @kishore_padamata's replies or do you still need more help here? Do let us know.
Thanks!

Sukrity Wadhwa
Hari_07Author
Level 2
September 19, 2021
Yes Sukrity_Wadhwa, I am able to resolve.