Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Proxy not being generated properly
    primarykey
    data
    text
    <p>I have a WCF Service that needs to return a file from a database. To that end, I have created two MessageContract classes, one for input and one for output. The code is as follows:</p> <pre><code>[MessageContract] public class AttachmentFile { [MessageHeader(MustUnderstand = true)] public Int32 AttachmentID; [MessageHeader] public String FileName; [MessageBodyMember(Order = 1)] public Stream Data; public AttachmentFile(Attachment att) { AttachmentID = (Int32)att.AttachmentID; FileName = att.FileName; Data = new MemoryStream(att.FileBytes); } } [MessageContract] public class AttachmentFileID { [MessageBodyMember] public Int32 AttachmentID; } public AttachmentFile GetAttachmentFile(AttachmentFileID AttachmentID) { } </code></pre> <p>The generated WSDL looks correct:</p> <pre><code>&lt;wsdl:operation name="GetAttachmentFile"&gt; &lt;soap12:operation soapAction="http://tempuri.org/IAttachments/GetAttachmentFile" style="document"/&gt; &lt;wsdl:input name="AttachmentFileID"&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output name="AttachmentFile"&gt; &lt;soap12:header message="i0:AttachmentFile_Headers" part="AttachmentID" use="literal"/&gt; &lt;soap12:header message="i0:AttachmentFile_Headers" part="FileName" use="literal"/&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; </code></pre> <p>However, when I run <code>svcutil.exe <a href="http://localhost:8002/IAttachments?wsdl" rel="nofollow">http://localhost:8002/IAttachments?wsdl</a></code>, the generated code comes out as:</p> <pre><code>public string GetAttachmentFile(ref int AttachmentID, out System.IO.Stream Data) { AttachmentFileID inValue = new AttachmentFileID(); inValue.AttachmentID = AttachmentID; AttachmentFile retVal = ((IAttachments)(this)).GetAttachmentFile(inValue); AttachmentID = retVal.AttachmentID; Data = retVal.Data; return retVal.FileName; } </code></pre> <p>I'm sure I'm missing something simple, but I can't seem to find what it is. Does anyone have any clues to what could be causing this?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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