How to prevent WCF from being used in a byte array with automatic serialization as base-64 encoded string?

When a service is called, my client code transmits data. One of the data elements is an array of bytes, so WCF automatically encodes this into a base-64 string during serialization. The problem is that the contract for the service data expects an array of bytes, not a string, so deserializing the data will throw an exception: Waiting for the state of "Element" .. A "Text" with the name "", namespace '' was detected

How do I solve this problem?

+3
source share
3 answers

, , ? ? , base-64, , .

, XML , ; , SOAP ( MTOM) Base-64.

+2

. - (, )?

0

, [] int []. XML , int .

The downside is the need to manually modify data contracts if you re-create files from WSDL.

0
source

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


All Articles