WCF服务上传文件,服务器配置异常,求解决方案
SFxInvalidStreamInRequest 若要讓指定之作業中的要求成為資料流,作業必須包含 Stream 類型的單一參數。
接口如下:
[OperationContract(Name = "SKMMA502")]
[WebInvoke(UriTemplate = "UploadFile/{fileName}")]
int SKMMA502(string fileName, Stream fileContents);
<service behaviorConfiguration="ServiceBehavior" name="IF.Service_MMA501">
<endpoint address="soap" binding="basicHttpBinding" name="Service_MMA501"
bindingName="basicHttpBinding" contract="IF.I_MMA501" />
<endpoint address="rest" behaviorConfiguration="jsonBehavior"
binding="webHttpBinding" name="mexService_MMA501" bindingName="webHttpBinding"
contract="IF.I_MMA501" />
</service>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="64000000" maxReceivedMessageSize="64000000" maxBufferPoolSize="64000000" >
<readerQuotas maxDepth="64000000" maxStringContentLength="64000000" maxArrayLength="64000000" maxBytesPerRead="64000000" />
<security mode="None"/>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webHttpBinding"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
transferMode="Streamed">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>