Created
August 18, 2026 10:52
-
-
Save richmilne/4395ef13761936b892ff1044e1d8d601 to your computer and use it in GitHub Desktop.
Sending SOAP isAlive request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env bash | |
| ENV=t1 # or t2, e1 | |
| SENDER="SENDER" | |
| DOMAIN="example.com" | |
| HOST_SUFFIX=".....ws1ng-a" | |
| [ "$ENV" = "e1" ] && HOST_SUFFIX=".....-alsu001" | |
| URL=https://${ENV}-${HOST_SUFFIX}.${DOMAIN}:7001/.....WS/SManageEndpoint?wsdl | |
| echo $URL | |
| HEADERS=(-H "Content-Type: text/xml") | |
| if [ "$ENV" != "e1" ] | |
| then | |
| declare -x OAUTH=${ENV}oauth1.${DOMAIN}:7046 | |
| declare -x TOKEN=$(\ | |
| curl -sS \ | |
| -H "Content-Type: application/x-www-form-urlencoded" \ | |
| --data 'grant_type=client_credentials' \ | |
| --cert "$....._CERTFILE_FILEPATH:$....._CERTFILE_PASSWORD" \ | |
| https://${OAUTH}/nevisauth/services/SecurityTokenService/oauth2 | jq ".access_token") | |
| TOKEN=${TOKEN//\"/} # Remove the quotes surrounding token | |
| HEADERS+=(-H "Authorization: Bearer $TOKEN") | |
| fi | |
| echo "HEADERS=${HEADERS[@]}" | |
| curl -v "${HEADERS[@]}" --data ' | |
| <ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" | |
| xmlns:ns1="${DOMAIN}/common/types/IsAlive"> | |
| <ns0:Body> | |
| <ns1:IsAliveRequest> | |
| <MessageHeader> | |
| <MandantID>001001</MandantID> | |
| <MessageID>${SENDER}-0000000000-000-202411291720414716</MessageID> | |
| <Sender>${SENDER}</Sender> | |
| <SenderPlattform>T</SenderPlattform> | |
| </MessageHeader> | |
| <requestTime>1732897228</requestTime> | |
| </ns1:IsAliveRequest> | |
| </ns0:Body> | |
| </ns0:Envelope>' "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment