What C # data types are not WCF serializable?

We have C # entity classes that map to some of our SQL Server database tables. We need to be able to serialize these classes to send them back to the client, from the server, through WCF. For each SQL Server data type, we have the corresponding C # CLR data type in the associated object.

We have some SQL Server data types, such as Image and VarBinary, which we need to map to the C # CLR data type, so we can pass the data back to the client. The problem is that I don’t know which CLR data type to use for these image types and VarBinary SQL so that we can serialize them through WCF.

Thank.

+3
source share
3 answers

If you are not using binary transport, I expect WCF to be an extremely poor choice for sending binary files because SOAP and JSON are terrible to process. For example, you can pass an array of byte [], but it will be extremely verbose (especially in SOAP).

It is probably better to just BASE64 the data in a string and send it.

+1
source

, , , . , , CLR , , ? NetXXX (, NetTcpBinding), , .NET-, . , base64. ( WebHttpBinding WSHttpBinding - ), , , base64 - ( ). /, , .NET .

, !

+1
source

Source: https://habr.com/ru/post/1758022/


All Articles