开发者

WCF REST services 'unexpected end of file'

I have an ASP.NET web application where i am using WCF REST services to insert 500 reords but getting the error 'unexpected end of file' i have put

<bindings>
  <basicHttpBinding>
    <!-- Create a custom binding for our service to enable sending large amount of data -->
    <binding name="NewBinding0" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"  maxReceivedMessageSize开发者_开发问答="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"   maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>

  </basicHttpBinding>

</bindings>

in both client cofig and service config ,but the same issue exists...any solution for this


Solution is probably to stop and search for some articles about WCF and REST and learn at least essentials of the API you are trying to use.

basicHttpBinding is for SOAP services, not for REST services. REST services use webHttpBinding so it is hard to say what's going on in your application because your very first statement

I am using WCF REST services

is in direct collision with the rest of your question.


Mrnka is correct, you should be using webHttpBinding for REST. Your web.config file should have this:

    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
      <bindings>
        <webHttpBinding>
          <binding>
            //binding here
          </binding>
        </webHttpBinding>
      </bindings>

    <standardEndpoints>
        <webHttpEndpoint>
            <!-- 
        Configure the WCF REST service base address and the default endpoint 
             -->
    </system.serviceModel>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜