lpagnacco

CreatePackage exception - Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

0 votes

I have been using the .NET SDK solidly for about 6 weeks with no issue. My coworker mentioned 2 weeks ago that one day he suddenly could not create a signing package when he could the previous day. I could not reproduce the error (below) on my machine, so we had to pass some work onto another coworker due to time constraints.

I was working on my app Friday without issue, then today ran into the same error

When calling CreatePackage on the ESL Client, it throws an EslException with the message - "JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0." 

This package contains the exact same data that I was using Friday during testing.

I have tried various things on my machine, but I noticed that a new SSL cert was issued on https://sandbox.esignlive.com/ just today... Is this related?

Has anyone else run into this? How do I get past this?

Thanks in advance.


Attachments

Reply to: CreatePackage exception - Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

0 votes

Hi lpagnacco,

 

I encountered this error few times, and seems like it's because the API response is in HTML format (staring with <HTML>) instead of JSON, therefore the Newtonsoft threw this error. There could be other reasons why the API endpoint returns the wrong format, but on top of my head, it sounds like a connection issue.

To further trouble shoot with the issue, you can perform below tests:
(1)Check the OneSpan Sign API Url and API Key to see if they are both correct and in a match

(2)Test connection by invoking any other SDK function, like below:
string applicationVersion = eslClient.SystemService.GetApplicationVersion();

(3)Not sure if you are connecting through a proxy and certified by a trusted store. I did a quick test without proxy and the SSL certificate change doesn't affect me. So you may also want to try connect directly if this applies to you.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: CreatePackage exception - Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

0 votes

With some help from our internal team that manages our corporate proxy, we discovered that 407 errors were occurring, so we had to whitelist the sandbox in the proxy.

Our team says nothing changed on our proxy from Friday, but it's working regardless, so I suppose it doesn't matter.

Thanks for the suggestion; it helped me down a path I wouldn't have otherwise thought to go down. I really appreciate it!

 


Reply to: CreatePackage exception - Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

0 votes

Hi lpagnacco,

 

Very glad that my suggest could be helpful! Just my guess that maybe because we've changed the root CA of the certificate that wasn't be trusted by your proxy, therefore you have to explicitly add OneSpan Sign domain to the trust list instead.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off