简体   繁体   中英

Is it possible to make a webHttpBinding WCF service to answer binary?

I implemented this contract

[OperationContract]
[WebGet(UriTemplate = "{parameter}", BodyStyle= WebMessageBodyStyle.Bare)]
byte[] Operation(string parameter);

But, when I called the implementation, all I got was something like this:

<base64Binary xmlns="http://schemas.microsoft.com/2003/10/Serialization/">dGVzdA==</base64Binary>

Can't I remove this wrapper and this serialization?

Make it return Stream.

Stream Operation(string parameter)
{
   ...
   new MemoryStream(bytes);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM