Hi,
REST API using java/ws-rawclient outbound.
Need to send GET request to retrieve oauth2 token, then plug that token into https header {Bearer token} on outbound POST msg with HL7 payload. Token can also expire so I need to evaluate token from response and re-issue token request if expired.
Have the GET working, see the encrypted token in the header of ib-reply but can’t seem to extract it from the USERDATA. Have tried “keylget” and “string first” [looking for “token”] in userdata but not getting token value returned.
Output from Clover (19.1.1) logfile below:
Suggestions appreciated. Thanks!
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:08/31/2022 16:04:24] org.apache.cxf.interceptor.LoggingOutInterceptor:INFO: Outbound Message
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] —————————
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] ID: 3
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Address: https://masshiway-services-cert.hhs.state.ma.us/HHS/API/jwt/gettoken?scope=SyndromicAPIService&id=123
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Http-Method: GET
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Content-Type:
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Headers: {Authorization=[Basic VFVGVFNNRURDRVJUOiRIbDchZWUkdXJucSM4MDA=], Accept=[*/*]}
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Payload: MSH|^~\&||… …OBX|7|TX|10182-4^History of travel Narrative^LN|7|No||||||F
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] ————————————–
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:08/31/2022 16:04:24] org.apache.cxf.interceptor.LoggingInInterceptor:INFO: Inbound Message
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] —————————-
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] ID: 3
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Response-Code: 200
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Encoding: ISO-8859-1
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Content-Type: application/soap+xml;
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] Headers: {connection=[keep-alive], content-type=[application/soap+xml;], Date=[Wed, 31 Aug 2022 20:04:24 GMT], Keep-Alive=[timeout=75], Server=[], token=[eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJEUFY2MDEiLCJleHAiOjE2NjE5NzY1NjQuNzIsImF0b21pY3JvbGVfbW9kdWxlIjoiNDQzL0hIUy9BUEkvc2VydmljZS9ITDcvU3luZHJvbWljIiwiY2xpZW50X2lkIjoiVFVGVFNNRURDRVJUIn0.VQK2YD1zkCAConfjaXxnbTr3NwY-5GvVM8aanDMuHoCbm6KJcyORditQgA7edpEVawwMEh7TXEzxPvswmY3khYJX8Oh9Yh0aGjwSyuV2woBJNypv60saYv9YjNhdh2wAEZrD-myV9qTN4UVj-woNtj8Cr-eEHwDvW7DQgPjoMcc_jSkYI5-RteDubjqSs0HBrCT1fttDeIzHrQ5mO8gukUiXaleQhXu3Sc87eXO_OEvYD2rDMpDXQ4GwViSnukVL_-YLD3pCo_vfBkm-RLTbQfbrlNsV9tJ6mGqQzTQfhp-oByZ1dy5SkdXMBvzQ0M7ftCGuM_Z-wwZ-WjnEQsfgBQ], transfer-encoding=[chunked], X-Backside-Transport=[OK OK,FAIL FAIL], X-Global-Transaction-ID=[23056659630fbec8165abce1]}
[java:java:INFO/1:MDPH_Syndromic_REST_API_0:–/–/—- –:–:–] ————————————–
[tcl :out :INFO/0:MDPH_Syndromic_REST_API:08/31/2022 16:04:24] userdata = {httpResponseInfo OK} {httpResponseHeaders {{Keep-Alive timeout=75} {transfer-encoding chunked} {Server {}} {X-Backside-Transport OK\ OK,FAIL\ FAIL} {connection keep-alive} {content-type application/soap+xml\;} {X-Global-Transaction-ID 23056659630fbec8165abce1} {Date Wed,\ 31\ Aug\ 2022\ 20:04:24\ GMT} {token eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJEUFY2MDEiLCJleHAiOjE2NjE5NzY1NjQuNzIsImF0b21pY3JvbGVfbW9kdWxlIjoiNDQzL0hIUy9BUEkvc2VydmljZS9ITDcvU3luZHJvbWljIiwiY2xpZW50X2lkIjoiVFVGVFNNRURDRVJUIn0.VQK2YD1zkCAConfjaXxnbTr3NwY-5GvVM8aanDMuHoCbm6KJcyORditQgA7edpEVawwMEh7TXEzxPvswmY3khYJX8Oh9Yh0aGjwSyuV2woBJNypv60saYv9YjNhdh2wAEZrD-myV9qTN4UVj-woNtj8Cr-eEHwDvW7DQgPjoMcc_jSkYI5-RteDubjqSs0HBrCT1fttDeIzHrQ5mO8gukUiXaleQhXu3Sc87eXO_OEvYD2rDMpDXQ4GwViSnukVL_-YLD3pCo_vfBkm-RLTbQfbrlNsV9tJ6mGqQzTQfhp-oByZ1dy5SkdXMBvzQ0M7ftCGuM_Z-wwZ-WjnEQsfgBQ}}} {httpResponseCode 200}
[tcl :out :INFO/0:MDPH_Syndromic_REST_API:08/31/2022 16:04:24] responseCd = httpResponseCode 200
[xlt :rout:ERR /0:oauth2_Test_xlate:08/31/2022 16:04:24] [0.0.422980] No reply route defined for trxid ” and destination ‘2_x_Syndromic_CrossSite’. Please define a route with ‘2_x_Syndromic_CrossSite’ as one of its destinations in “Route Replies”
Engine idle — 08/31/2022 16:04:34