Other [B4X] .Net Framework implementation of B4XSerializator EXAMPLE

androidappl

Active Member
Licensed User
Longtime User
The only reason to use .Net Framework is if you have an existing .Net server. It will be much easier to implement a server with B4J.
exact I dispose of an old server (vb) + a handler written in vb.net and I wish I could connect and especially communicate with B4A for example.

I could use an example just stupid sending communication and receipt of a string. I would be most grateful.

Thank you
 
Upvote 0

androidappl

Active Member
Licensed User
Longtime User
good morning,

I came to the point that side .net (c #) I receive the item you serialize:

B4X:
B4XSerializator ser = new B4XSerializator();

object m =  ser.ConvertBytesToObject(StreamExtensions.ToByteArray(result));

Then how do I convert the object type "object" in a c # dictionary?
 
Upvote 0

androidappl

Active Member
Licensed User
Longtime User
B4X:
                    byte[] databytes = ser.ConvertObjectToBytes(sql_risp["DATI"]);
                    response = Request.CreateResponse(HttpStatusCode.OK, new { Message = "Hello", Value = databytes });

The answer is accepted by the Web server API (c #) B4A but when the client receives the reply, can not serilizate object ....

Suggestions?


Error this:
Error reading response: (DataFormatException) java.util.zip.DataFormatException: incorrect header check
 
Upvote 0

androidappl

Active Member
Licensed User
Longtime User
B4X:
Dictionary<Object, Object> d = (Dictionary<Object, Object>) m;

solved for now the current status is as follows: (I'm okay)

CLIENT (B4X) -> Send an object dbcomand (bytes)
SERVER - WEB API (C #) -> It receives the call and the object. Read the object (b4xserializator).
SERVER - WEB API (C #) -> makes the sql requests or other activities.
SERVER - WEB API (C #) -> Send the answer to the client in JSON format. if sql with results.
CLIENT (B4X) -> Receives the response and displays the results.
 
Upvote 0
Top