title: All parameters in Web Service contract operations cannot be a null
body: <p>When I am adding one method to my Web Service I get the error when open the WSDL in the browser:</p>
  
  <blockquote>
    <p>All parameters in Web Service contract operations cannot be a null</p>
  </blockquote>
  
  <p>Here is method declaration:</p>
  
  <pre><code>[&lt;System.ServiceModel.Web.WebInvokeAttribute&gt;]
  abstract PostFile: System.IO.Stream -&gt; bool
  </code></pre>
  
  <p>And here is a current method implementation:</p>
  
  <pre><code>member x.PostFile(stream : Stream) : bool =
          let filepath = Path.Combine(System.Environment.CurrentDirectory, "uploadedfile.jpg")                
  
          try
              let outstream : FileStream = File.Open(filepath, FileMode.Create, FileAccess.Write)
              let bufferLen : int = 4096
              let buffer : byte array = Array.zeroCreate bufferLen
              let count : int = 0
  
              let mutable count = stream.Read(buffer, 0, bufferLen)
              if count &gt; 0 then
                  outstream.Write(buffer, 0, count)
  
              while (count &gt; 0) do
                  count &lt;- stream.Read(buffer, 0, bufferLen)
                  outstream.Write(buffer, 0, count)
  
              outstream.Close()
              stream.Close()
              true
          with
              | exn -&gt;
                  printfn "Exception: \n%s" exn.Message
                  reraise()
  </code></pre>
  
  <p>Here is a <a href="http://pastebin.com/LREHZX0V" rel="nofollow">full stack from the browser</a> (sorry, for russian).</p>
  
  <p>If I comment this one (and only one method) all works fine.  What is the reason of the error and how can I fix it?</p>