You need to sign in to do that
Don't have an account?
Rajesh Rajesh Kumar
Eorror code :500
Hii
"error": {
"code": 500,
"message": ""Cannot coerce Null (null) to String

1| 'ex1' ++ payload.uci.customer.contract.applicationId as String ++ '.txt'
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Trace:
 at ++ (line: 1, "
},
"error": {
"code": 500,
"message": ""Cannot coerce Null (null) to String

1| 'ex1' ++ payload.uci.customer.contract.applicationId as String ++ '.txt'
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Trace:
 at ++ (line: 1, "
},
Basically, this error message means something went wrong at their end.
-Open your URL it through..normal..IE..I think that URL will be prohibited..and restricted that's why it occurs.
-Or you have registered the endpoint URL in the Remote Site Settings white list. It wouldn't cause a HTTP500 error, but might be worth checking.
-Or Try to set the content type as below.
req.setHeader('content-type', 'text/XML');
Set the username, password and the API Key as follows.
Blob headerValue = Blob.valueOf(API_KEY+ ' ' + username + ' ' + password );
This will resolve the 500 issue.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha