Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you can't transfer in the message body a Stream and another data. You need to use a MessageContract to add custom data in the header of the message, and the stream in the body.</p> <p>You need to use a specific contract. You can use class with messagecontract which encapsulate your current contract. Like this :</p> <pre><code>[ServiceContract] public interface IFileDownloadService { [OperationContract] StreamResponse DownloadFile(DownloadFileCommandRequest command); } [MessageContract] public class StreamResponse { [MessageHeader()] public CommandResult&lt;FileDownloadDTO&gt; {get; set;} [MessageBodyMember(Order = 1)] public Stream FileByteStream { get; set; } } [MessageContract] public class DownloadFileCommandRequest { [MessageBodyMember(Order = 1)] public DownloadFileCommand FileCommand {get; set;} } </code></pre> <p>And remove the stream property in FileDownloadDTO class. Maybe if you only remove the DataMember attribute it's ok.</p> <pre><code>[DataContract] public class FileDownloadDTO : IDisposable, IDTOBase { [DataMember] public string FileName { get; set; } [DataMember] public long Length { get; set; } [DataMember] public int Id { get; set; } } </code></pre> <p>Here, an exemple of the client configuration.</p> <pre><code>&lt;binding name="FileHttpBinding" closeTimeout="04:01:00" openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" messageEncoding="Mtom"&gt; &lt;readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt; &lt;security mode="None"&gt; &lt;/security&gt; &lt;/binding&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload