Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/16/2024 09:50 AM - last edited on 10/16/2024 10:10 AM by Dave
Hi,
we have to send xmlmessage in httpparams for REST application.
we are getting the xmlmessage in arstasks.comments and sending in httpparams like below.
json:
{
"accountIdPath": "accountName",
"call": [
{
"name": "Access-Role",
"connection": "userAuth",
"url": "https://host/deleteEntitlements",
"httpMethod": "DELETEWITHBODY",
"httpParams":"{\"sso\":\"${user.username}\",\"appName\":\"A 2.0\",\"firstName\":\"${user.firstname}\",\"lastName\":\"${user.lastname}\",\"email\":\"${user.email}\",\"xmlMessage\": \"<Roles>${arsTasks.comments}</Roles>\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
500
]
}
}
]
}
arsTasks.comments getting form enhanced query execution like below:
<Role><AppRole>TreasuryApprover</AppRole><Site>All</Site></Role><Role><AppRole>Requestor</AppRole><Site>Gas Power HQ non project related TFIs</Site></Role>
but in logs, when calling the webservice saviynt is encoding the xml tags like below, and target API is not accepting the format: < to < and >>
quartzScheduler_Worker-10-qr5gw-DEBUG-Calling Webservice Url - https://qa-aloc.example.com/aloc-services/deleteEntitlements with httpParams - [sso:123456789, appName:ALOC 2.0, TestFirstName, TestLastName:Test012, email:test.email@domain.com, xmlMessage:<Roles><Role><AppRole>TreasuryApprover</AppRole><Site>All</Site></Role><Role><AppRole>Requestor</AppRole><Site>Gas Power HQ non project related TFIs</Site></Role></Roles>]
How to stop this special char encoding in xmlmessage when calling webservise?
[This post has been edited by a Moderator to remove sensitive information.]
10/16/2024 09:58 AM - edited 10/16/2024 09:59 AM
@sudheera change content type to text/xml
Instead of below
Content-type": "application/json"
10/17/2024 12:39 AM - last edited on 10/17/2024 02:05 AM by Sunil
Hi,
after changing the content type also it is calling in same format as below:
quartzScheduler_Worker-3-qr5gw-DEBUG-Calling Webservice Url - https://host/deleteEntitlements with httpParams - [sso:503508027, appName:ALOC 2.0, firstName:SHANTANU, lastName:Test012, email:shantanu.test012@removed.com, xmlMessage:<Roles><Role><AppRole>TreasuryApprover</AppRole><Site>All</Site></Role><Role><AppRole>Requestor</AppRole><Site>Gas Power HQ non project related TFIs</Site></Role></Roles>]
[This message has been edited by moderator to mask sensitive information]
10/16/2024 11:23 AM - edited 10/16/2024 11:24 AM
{
"accountIdPath": "accountName",
"call": [
{
"name": "Access-Role",
"connection": "userAuth",
"url": "https://host/deleteEntitlements",
"httpMethod": "DELETEWITHBODY",
"httpParams": "{\"sso\":\"${user.username}\",\"appName\":\"A 2.0\",\"firstName\":\"${user.firstname}\",\"lastName\":\"${user.lastname}\",\"email\":\"${user.email}\",\"xmlMessage\": \"<Roles>${org.apache.commons.lang.StringEscapeUtils.escapeJava(arsTasks.comments)}</Roles>\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-type": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
500
]
}
}
]
}
10/17/2024 12:27 AM - last edited on 10/17/2024 02:05 AM by Sunil
HI,
Still it is calling webservice in encoded only
quartzScheduler_Worker-6-v9kj5","DEBUG","Calling Webservice Url - https://qa-aloc.treasury.ge.com/aloc-services/deleteEntitlements with httpParams - [sso:503508027, appName:ALOC 2.0, firstName:SHANTANU, lastName:Test012, email:shantanu.test012@removed.com, xmlMessage:<Roles><Role><AppRole>TreasuryApprover</AppRole><Site>All</Site></Role><Role><AppRole>Requestor</AppRole><Site>Gas Power HQ non project related TFIs</Site></Role></Roles>]"