Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Unterminated string at character - soap connector

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 5 2021 at 09:07 UTC

 Hi Everyone,


currently we are working on a SOAP connector with provision accounts in SAP PO application.


The create account JSON we have used is :


[
{
    "CONNECTION" : "login",
    "REQUESTXML" : ["<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"> <SOAP-ENV:Header></SOAP-ENV:Header> <SOAP-ENV:Body> <spml:addRequest requestID=\"add-1\" xmlns=\"urn:oasis:names:tc:SPML:1:0\" xmlns:spml=\"urn:oasis:names:tc:SPML:1:0\" xmlns:dsml=\"urn:oasis:names:tc:DSML:2:0:core\"> <spml:attributes>
    <spml:attr name=\"objectclass\"> <dsml:value>sapuser</dsml:value> </spml:attr>
    <spml:attr name=\"logonname\"> <dsml:value>Z_POCTST1</dsml:value> </spml:attr> <spml:attr name=\"lastname\"> <dsml:value>Test</dsml:value> </spml:attr> <spml:attr name=\"firstname\"> <dsml:value>POC</dsml:value> </spml:attr> <spml:attr name=\"email\"> <dsml:value>Z_POCTST1@cmsenergy.com</dsml:value> </spml:attr> <spml:attr name=\"validto\"> <dsml:value>20251231000000Z</dsml:value> </spml:attr> <spml:attr name=\"password\"> <dsml:value>Welcome@123</dsml:value> </spml:attr> </spml:attributes> </spml:addRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"],
"RESPONSEMAPPING":{
    "ADDUSERRESPONSE" : "Body.addResponse.identifier.id.nodeexists"
    },
    "SUCCESSCRITERIA" : {"ADDUSERRESPONSE": "1"}
    }
]


But it is giving an error :

Caused by: org.codehaus.groovy.grails.web.json.JSONException: Unterminated string at character 368 


Tried going through the JSON multiple times but seems good to me.


Snippet from the logs :


2021-11-05/08:14:45.752 [{{error.id,9d88f790e28ec28771e749460906cfec}{trace.id,56c7d8a099def2bb366736eee8c383b7}{transaction.id,2e7d3f78af6e5a7e}}] [quartzScheduler_Worker-2]  ERROR provisoning.SoapProvisioningService - Error occured in creating account
org.codehaus.groovy.grails.web.converters.exceptions.ConverterException: Error parsing JSON
    at grails.converters.JSON.parse(JSON.java:292)
    at com.saviynt.provisoning.SoapProvisioningService.getSpecificJson(SoapProvisioningService.groovy:2072)
    at com.saviynt.provisoning.SoapProvisioningService.createAccount(SoapProvisioningService.groovy:2524)
    at com.saviynt.provisoning.SoapProvisioningService.createAccount(SoapProvisioningService.groovy:2467)
    at com.saviynt.ecm.services.ArsTaskService.createAccountTarget(ArsTaskService.groovy:10794)
    at com.saviynt.ecm.services.ArsTaskHelperService$_whenTaskTypeIsThreeNewAccountAccess_closure46.doCall(ArsTaskHelperService.groovy:2828)
    at com.saviynt.ecm.services.ArsTaskHelperService.whenTaskTypeIsThreeNewAccountAccess(ArsTaskHelperService.groovy:2819)
    at com.saviynt.ecm.services.ArsTaskHelperService$_completeAutoProvTasksUpgraded_closure1.doCall(ArsTaskHelperService.groovy:167)
    at com.saviynt.ecm.services.ArsTaskHelperService.completeAutoProvTasksUpgraded(ArsTaskHelperService.groovy:152)
    at MultipleProvisioningJob.execute(MultipleProvisioningJob.groovy:216)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: org.codehaus.groovy.grails.web.json.JSONException: Unterminated string at character 368 of [
{
    "CONNECTION" : "login",
    "REQUESTXML" : ["<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"> <SOAP-ENV:Header></SOAP-ENV:Header> <SOAP-ENV:Body> <spml:addRequest requestID=\"add-1\" xmlns=\"urn:oasis:names:tc:SPML:1:0\" xmlns:spml=\"urn:oasis:names:tc:SPML:1:0\" xmlns:dsml=\"urn:oasis:names:tc:DSML:2:0:core\"> <spml:attributes>
    <spml:attr name=\"objectclass\"> <dsml:value>sapuser</dsml:value> </spml:attr>
    <spml:attr name=\"logonname\"> <dsml:value>Z_POCTST1</dsml:value> </spml:attr> <spml:attr name=\"lastname\"> <dsml:value>Test</dsml:value> </spml:attr> <spml:attr name=\"firstname\"> <dsml:value>POC</dsml:value> </spml:attr> <spml:attr name=\"email\"> <dsml:value>Z_POCTST1@cmsenergy.com</dsml:value> </spml:attr> <spml:attr name=\"validto\"> <dsml:value>20251231000000Z</dsml:value> </spml:attr> <spml:attr name=\"password\"> <dsml:value>Welcome@123</dsml:value> </spml:attr> </spml:attributes> </spml:addRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"],
"RESPONSEMAPPING":{
    "ADDUSERRESPONSE" : "Body.addResponse.identifier.id.nodeexists"
    },
    "SUCCESSCRITERIA" : {"ADDUSERRESPONSE": "1"}
    }
]


This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
2 REPLIES 2

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 5 2021 at 17:42 UTC

Shubham,


This looks like it is an issue with white spaces/new line. Please ensure that you have the SOAP payload in a single line.


Something like this and try.


[

{

    "CONNECTION" : "login",

    "REQUESTXML" : ["<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"> <SOAP-ENV:Header></SOAP-ENV:Header> <SOAP-ENV:Body> <spml:addRequest requestID=\"add-1\" xmlns=\"urn:oasis:names:tc:SPML:1:0\" xmlns:spml=\"urn:oasis:names:tc:SPML:1:0\" xmlns:dsml=\"urn:oasis:names:tc:DSML:2:0:core\"> <spml:attributes><spml:attr name=\"objectclass\"> <dsml:value>sapuser</dsml:value> </spml:attr><spml:attr name=\"logonname\"> <dsml:value>Z_POCTST1</dsml:value> </spml:attr> <spml:attr name=\"lastname\"> <dsml:value>Test</dsml:value> </spml:attr> <spml:attr name=\"firstname\"> <dsml:value>POC</dsml:value> </spml:attr> <spml:attr name=\"email\"> <dsml:value>Z_POCTST1@cmsenergy.com</dsml:value> </spml:attr> <spml:attr name=\"validto\"> <dsml:value>20251231000000Z</dsml:value> </spml:attr> <spml:attr name=\"password\"> <dsml:value>Welcome@123</dsml:value> </spml:attr> </spml:attributes> </spml:addRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"],

"RESPONSEMAPPING":{

    "ADDUSERRESPONSE" : "Body.addResponse.identifier.id.nodeexists"

    },

    "SUCCESSCRITERIA" : {"ADDUSERRESPONSE": "1"}

    }

]




Regards,

Avinash Chhetri


This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 8 2021 at 06:18 UTC

 This worked, Thanks avinash!

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.