WCF REST服务
问题描述:
“意外的文件结尾”我有我在哪里使用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和服务配置,但同样的问题存在...任何解决方案此
答
解决方案可能会停止和搜索一些关于WCF和REST的文章,并至少学习您尝试的API的必要条件使用。
basicHttpBinding
适用于SOAP服务,不适用于REST服务。 REST服务使用webHttpBinding
所以很难说这是怎么回事在您的应用程序,因为你的第一个声明
我使用WCF REST服务
与你的问题的其余部分直接碰撞。
答
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>