Apex call to getPackage() method not working
Wednesday, June 14, 2017 at 01:02pmI am using a sandbox so perhaps the class definition does not match what is there.
I get an invalid primitive error on the following code snippet:
string pkgId = ESignLiveExamples.createPackageExample();
ESignLiveSDK sdk = new ESignLiveSDK();
ESignLiveAPIObjects.Package_x pkg = sdk.getPackage(pkgId);
Here is the error on my page: Error getting the Package: Illegal value for primitive
Error is in expression '{!TestESL}' in component in page espackage: Class.ESignLiveRESTAPIHelper.getPackage: line 772, column 1
Class.ESignLiveSDK.getPackage: line 210, column 1
Class.ESPackageController.TestESL: line 96, column 1
Line 772 is the throw statement below. So the JSON.deserialize is failing.
try
{
pkg = (ESignLiveAPIObjects.Package_x)JSON.deserialize(inboundResponseBody, ESignLiveAPIObjects.Package_x.class);
}
catch(Exception e)
{
throw new ESignLiveRestAPIHelperException('Error getting the Package: ' + e.getMessage());
}
Digging a little more the Package_x.document.data field is defined in the class as a string. The return value is a class.
Reply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 06:56amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 07:37amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 09:15amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 09:50amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 09:57amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 11:12amReply to: Apex call to getPackage() method not working
Thursday, June 15, 2017 at 12:42pmReply to: Apex call to getPackage() method not working
Friday, June 16, 2017 at 11:33amReply to: Apex call to getPackage() method not working
Friday, June 16, 2017 at 12:07pmReply to: Apex call to getPackage() method not working
Friday, June 16, 2017 at 12:55pmReply to: Apex call to getPackage() method not working
Friday, June 16, 2017 at 06:02pmReply to: Apex call to getPackage() method not working
Friday, June 16, 2017 at 07:30pmReply to: Apex call to getPackage() method not working
Wednesday, June 28, 2017 at 03:37am