2011-07-21 77 views
1

「意外的文件結尾」我有我在哪裏使用WCF REST服務,以插入500個reords但得到的錯誤我已經把WCF REST服務

<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> 
「意外的文件結尾」 ASP.NET Web應用程序

在客戶端cofig和服務配置,但同樣的問題存在...任何解決方案此

回答

4

解決方案可能會停止和搜索一些關於WCF和REST的文章,並至少學習您嘗試的API的必要條件使用。

basicHttpBinding適用於SOAP服務,不適用於REST服務。 REST服務使用webHttpBinding所以很難說這是怎麼回事在您的應用程序,因爲你的第一個聲明

我使用WCF REST服務

與你的問題的其餘部分直接碰撞。

0

Mrnka是正確的,你應該使用webHttpBinding for REST。你的web.config文件應該是這樣的:

<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>