EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Post json data to server will cause a exception.

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#33303
Posted: 05/15/2015 00:46:07
by Fanglin Liu (Priority Standard support level)
Joined: 05/14/2015
Posts: 33

The request is as follows:

requestUriString = "https://atlas-a.wbx2.com/admin/api/v1/users/email/verify";
contentStr = "{\"email\":\"fanglliu@cisco.com\"}";

HttpClient.RequestParameters.ContentType = "application/json";
HttpClient.RequestParameters.Authorization = "Bearer ......";
HttpClient.RequestParameters.UserAgent = "wx2-winphone";

int statusCode = await HttpClient.PostAsync(requestUriString, contentStr);

The above code will cause exception. But I can successfully post this request in the windows phone native http client and in a Chrome REST test client. The exception is as follows:

{SBHTTPSClient.EElHTTPSConnectionShutdownError: Connection lost (error code is 100353)
at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)
at SBHTTPSClient.TElHTTPSClient.Post(String URL, String Content)
at SBHTTPSClient.Async.TElHTTPSClient_AsyncExtensions.<>c__DisplayClass25.<PostAsync>b__24()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at TestSecureBlackBox.App.<TestPost1Async>d__9.MoveNext()}
[SBHTTPSClient.EElHTTPSConnectionShutdownError]: {SBHTTPSClient.EElHTTPSConnectionShutdownError: Connection lost (error code is 100353)
at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)
at SBHTTPSClient.TElHTTPSClient.Post(String URL, String Content)
at SBHTTPSClient.Async.TElHTTPSClient_AsyncExtensions.<>c__DisplayClass25.<PostAsync>b__24()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at TestSecureBlackBox.App.<TestPost1Async>d__9.MoveNext()}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
HResult: 0x80131500
InnerException: null
Message: "Connection lost (error code is 100353)"
Source: "SecureBlackbox.HTTP"
StackTrace: " at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)\r\n at SBHTTPSClient.TElHTTPSClient.Post(String URL, String Content)\r\n at SBHTTPSClient.Async.TElHTTPSClient_AsyncExtensions.<>c__DisplayClass25.<PostAsync>b__24()\r\n at System.Threading.Tasks.Task`1.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at TestSecureBlackBox.App.<TestPost1Async>d__9.MoveNext()"
#33307
Posted: 05/15/2015 03:33:35
by Fanglin Liu (Priority Standard support level)
Joined: 05/14/2015
Posts: 33

This happened 100%. Could you let me know how to post a json data with SecureBlackBox.
#33308
Posted: 05/15/2015 03:44:00
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Your code is correct. We have also TElRESTClient class that allows to send/receive JSON, but its based on TElHTTPSClient and its better to proceed with TElHTTPSClient to solve the connectivity problem.

May I ask you to check if the same problem occurs with our desktop sample. This will help us to understand if the problem is Windows Phone specific or more general.
#33309
Posted: 05/15/2015 03:49:10
by Fanglin Liu (Priority Standard support level)
Joined: 05/14/2015
Posts: 33

Thanks for your quick support.
OK. Let me try it on Windows Desktop.
#33310
Posted: 05/15/2015 04:09:53
by Fanglin Liu (Priority Standard support level)
Joined: 05/14/2015
Posts: 33

I tried NET_451_Desktop, NET_451_WinRT and NET_451_WinStore. All of these library throw an exception.
This is the exception when I try SecureBlackbox.NET\Assemblies\NET_451_WinStore.

{"Connection lost (error code is 100353)"}
Data: {System.Collections.ListDictionaryInternal}
ErrorCode: 0x00018801
FErrorCode: 0x00018801
FSupplErrorCode: 0x00000000
HResult: 0x80131500
HelpLink: null
InnerException: null
Message: "Connection lost (error code is 100353)"
Source: "SecureBlackbox.HTTP"
StackTrace: " at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)\r\n at SBHTTPSClient.TElHTTPSClient.Post(String URL, String Content)\r\n at SBHTTPSClient.Async.TElHTTPSClient_AsyncExtensions.<>c__DisplayClass25.<PostAsync>b__24()\r\n at System.Threading.Tasks.Task`1.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at TestPostDesktop.App.<TestPost1Async>d__1.MoveNext()"
SupplErrorCode: 0x00000000
TargetSite: {Int32 PerformRequest(Int32, System.String)}
#33311
Posted: 05/15/2015 04:19:52
by Vsevolod Ievgiienko (EldoS Corp.)

I welcome you to continue the conversation in the Helpdesk ( https://www.eldos.com/helpdesk/ ). I've already created a ticket for you.

Helpdesk is our easy-to-use ticketing system that allows communicating and exchanging sample data with our support personnel privately. You will also get e-mail notifications about updates of your support ticket.
#33312
Posted: 05/15/2015 04:59:49
by Fanglin Liu (Priority Standard support level)
Joined: 05/14/2015
Posts: 33

Thanks Vsevolod
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 1013 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!