- 0
[C#] Am I missing a pitfall with base64 encode sending?
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Microsoft has delayed Outlook REST API deprecation indefinitely due to customer feedback
By Usama Jawad96,
- 0 replies
- 3 views
-
KB5012643 is causing issues with some apps in Windows 11, but there's a workaround
By Usama Jawad96,
- microsoft
- windows 11
- (and 12 more)
- 3 replies
- 14 views
-
- 12 answers
- 11,276 views
-
- 2 answers
- 2,249 views
-
- 2 answers
- 2,001 views
-
Question
sathenzar
I am always learning different parts of the C# language b/c lets face it, it's a lot of fun :). I've decided to configure my wcf service as a rest service which supports json request/response instead of xml. All has gone well and I can serialize/deserialize my messages into complex classes so far, unless I send a bunch of data in them. I've tried to change my readerQuotas, etc, etc but everytime I try to make a call it says "Error: Bad Data". I know the service works because I can call simple functions and pass data to/from the service. But if I pass a class with 3 byte[] properties each 128 bytes in length it fails. If I pass the same class with each byte[] param with 3 bytes of data it goes through (I base64 encode each complex class after serializing them). Here is my example code:
This example passes and goes through:
GetTestSalesRequest req = new GetTestSalesRequest() { CurrentTest = new byte[] { 1 }, CurrentMTest = new byte[] { 4 }, UserName = this.gl_userName,// <---- is a string UserPwd = new byte[] { 2 } }; string test = await this.gl_client2.TestFunc(req); System.Diagnostics.Debug.WriteLine("Testtion: {0}", test);
This example fails.
Is there a pitfall I'm going into here? What am I missing that is really obvious because this has to be possible to be done.
Link to comment
https://www.neowin.net/forum/topic/1126840-c-am-i-missing-a-pitfall-with-base64-encode-sending/Share on other sites
10 answers to this question
Recommended Posts