Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Removing double quotes in Update Account JSON - SOAP connector

smithamg
Regular Contributor
Regular Contributor

Hi Team, 

I want to remove double quotes from input am passing to SOAP API request. 

  • I want to get the unique identifier from target with first soap call and pass it in subsequent call in Update Account JSON. 

I am getting unique identifier within quotes from call1. Example: "abc" but this not valid to pass in call2. API accepts input value without quotes ie. abc.

How can I remove " in JSON.

Attached is the JSON I tried.

Thanks,
Smitha

7 REPLIES 7

RakeshMG
Saviynt Employee
Saviynt Employee

Please try (\"'\",\"''\")


​Regards

Rakesh M Goudar

smithamg
Regular Contributor
Regular Contributor

Hi Rakesh,

I tried as you suggested but it's not working, task is still pending.

[
{
"CONNECTION": "acctAuth",
"REQUESTXML": "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:enab=\"enablon\"><soapenv:Header><UserInfo xsi:type=\"wsdl:AuthHeader\" xmlns:wsdl=\"http://enablon/wsdl/\"><EnaHomeSite xsi:type=\"xsd:string\">HAL810.Test</EnaHomeSite><EnaUserName xsi:type=\"xsd:string\">${USERNAME}</EnaUserName><EnaPassword xsi:type=\"xsd:string\">${PASSWORD}</EnaPassword></UserInfo></soapenv:Header><soapenv:Body><enab:ExportData soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><Table xsi:type=\"xsd:string\">/ho/Users</Table><FolderId xsi:type=\"xsd:int\">0</FolderId><Fields xsi:type=\"xsd:string\">Business Card</Fields><Filter xsi:type=\"xsd:string\">UserId=\\\"${user.email}\\\"</Filter><CSVSeparator xsi:type=\"xsd:int\">1</CSVSeparator><FormatOptions xsi:type=\"xsd:int\">22</FormatOptions><FormatType xsi:type=\"xsd:int\">0</FormatType><ExportOptions xsi:type=\"xsd:int\">1</ExportOptions></enab:ExportData></soapenv:Body> </soapenv:Envelope>",
"SOAPACTION": "ExportData",
"RESPONSEMAPPING":{
"BUSINESSCARD": "Body.ExportDataResponse.Data"
},
"CONNECTION": "acctAuth",
"REQUESTXML2": "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance/\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:enab=\"enablon\"><soapenv:Header><UserInfo xsi:type=\"wsdl:AuthHeader\" xmlns:wsdl=\"http://enablon/wsdl/\"><EnaHomeSite xsi:type=\"xsd:string\">HAL810.Test</EnaHomeSite><EnaUserName xsi:type=\"xsd:string\">${USERNAME}</EnaUserName><EnaPassword xsi:type=\"xsd:string\">${PASSWORD}</EnaPassword></UserInfo></soapenv:Header><soapenv:Body><enab:ImportData soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><Table xsi:type=\"xsd:string\">/ho/Users</Table><FolderId xsi:type=\"xsd:int\">0</FolderId><Data xsi:type=\"xsd:string\">Business Card;First Name;Last Name;\n${BUSINESSCARD.replaceAll(\"'\",\"''\").trim()};${user.firstname};${user.lastname}</Data><FormatType xsi:type=\"xsd:int\">1</FormatType><CSVSeparator xsi:type=\"xsd:int\">1</CSVSeparator><FormatOptions xsi:type=\"xsd:int\">16</FormatOptions><ImportType xsi:type=\"xsd:int\">1</ImportType><MatchType xsi:type=\"xsd:int\">1</MatchType><ImportOptions xsi:type=\"xsd:int\">8</ImportOptions></enab:ImportData></soapenv:Body></soapenv:Envelope>",
"SOAPACTION": "ImportData",
"RESPONSEMAPPING":{
"SUCCESSRESPONSE" : "Body.ImportDataResponse.Response.RowSuc"
},
"SUCCESSCRITERIA" : "SUCCESSRESPONSE=1",
"FAILURECRITERIA":"SUCCESSRESPONSE=0"
}
]

RakeshMG
Saviynt Employee
Saviynt Employee

You have to use it for the attribute for which you want to replace like :

"displayName": "${user.displayname.replace ('"','\\"')}"


​Regards

Rakesh M Goudar

DixshantValecha
Saviynt Employee
Saviynt Employee

I appreciate you reaching out to the Saviynt forums.

You have to use it for the attribute for which you want to replace like :

"displayName": "${user.displayname.replace ('"','\\"')}"

Using https://jsonformatter.org/ you have the ability to verify the format of your JSON.

  1. If there are no errors, the tool will display a message indicating that your JSON is valid. You can then click the "Beautify/Format" button to format your JSON in a more readable way.

Hi Rakesh, Dixshant,

I tried your suggestion but no luck. My JSON is valid and I have validated it using Online JSON validator. I am not seeing detailed logs for this.

  • Is there a way to get detailed logs for SOAP Connector? In log I see just 'Error while UPDATE ACCOUNT for account ***** - SUCCESSCRITERIA not matched', it's not showing exactly what went wrong.
  • Is it possible to handle timeout error from SOAP API calls like we have in REST connector. We observed that SOAP API calls fail to get response with time out error through its intermittent.

Thanks,
Smitha

smithamg
Regular Contributor
Regular Contributor

Hi team,

I got answers for my queries

  • The most detail you can get is by enabling "debugenabledforconnectors" (set =true) within the externalconfig.properties file.  Beyond that there is no additional logging for the SOAP connector.
  • The SOAP connector template does not have a timeout, however you can specify timeouts in each individual JSON.  Check the Cerner guide for an example of this as well.

But my JSON is still not working.

Thanks,
Smitha

smithamg
Regular Contributor
Regular Contributor

Below syntax worked for me to remove double quotes ${account.customproperty1.replaceAll(\"\\\\\"\",\"\")}