开发者

How to set up bindings in webconfig to enable streaming in RESTful WCF service

I have a RESTful service which I'm trying to enable to accept a PDF file. I'm using a stream to transport it, but I keep running into mysterious errors in the process.

My first error is this: Security negotiation failed because the remote party did not send back a reply in a ti开发者_如何学Gomely manner. This may be because the underlying transport connection was aborted.

Not sure what's causing that. Also, I tried adding a customBinding in an attempt to fix this error, and I get an error that says I don't have my binding set up properly.

My main, overall question is this: Does anyone know of a simple binding and complete instructions for how to set it up to enable streaming?


I managed to get it working. I found that my problem wasn't my binding, but that it was never registered. Here's the code in the web.config file:

<services>
    <service name="ResearchUploadService.Service1" behaviorConfiguration="ResearchUploadService.Service1Behavior">
    <endpoint address="" binding="customBinding" bindingConfiguration="basicConfig" contract="ResearchUploadService.IService1"/>            
    </service>
</services>
...
<bindings>
    <customBinding>
        <binding name="basicConfig">
           <binaryMessageEncoding/>
           <httpTransport transferMode="Streamed" maxReceivedMessageSize="67108864"/>
        </binding>
     </customBinding>
</bindings>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜