Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Session token generation using shell script?

Avatar

Level 2

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!

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

kishorep_0-1629895982663.pngkishorep_1-1629895994469.png

 

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

kishorep_2-1629896039190.png


Hope this helps!

View solution in original post

4 Replies

Avatar

Employee Advisor

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.

Avatar

Correct answer by
Employee Advisor

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.

kishorep_0-1629895982663.pngkishorep_1-1629895994469.png

 

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

kishorep_2-1629896039190.png


Hope this helps!

Avatar

Administrator

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!