function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajesh Rajesh KumarRajesh 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, "
    },
Deepali KulshresthaDeepali Kulshrestha
Hi Rajesh,

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