C# webHttpBinding发布1MB xml文件时出现问题
我有用于wcf服务的webHttpBinding。无法将大型xml文件(1MB)发布到获取以下错误请求的服务EntityToolArge(413)不是以下情况之一:确定(200)、创建(201)、接受(202)、非授权信息(203)、无内容(204)、重置内容(205)、部分内容(206)“}System.Exception{System.ArgumentOutOfRangeException} 以下是wcf服务的配置C# webHttpBinding发布1MB xml文件时出现问题,c#,xml,wcf,visual-studio,C#,Xml,Wcf,Visual Studio,我有用于wcf服务的webHttpBinding。无法将大型xml文件(1MB)发布到获取以下错误请求的服务EntityToolArge(413)不是以下情况之一:确定(200)、创建(201)、接受(202)、非授权信息(203)、无内容(204)、重置内容(205)、部分内容(206)“}System.Exception{System.ArgumentOutOfRangeException} 以下是wcf服务的配置 <service name="abc" > <
<service name="abc" >
<endpoint address="http://localhost:8741/LTLInboundService/" binding="webHttpBinding" behaviorConfiguration="WebHttpBehaviour" contract="abc" name="webHttpBinding_LTLInboundService" >
</endpoint>
</service>
<webHttpBinding>
<binding name="webHttpBinding_LTLInboundService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
transferMode="Streamed"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
它在响应时失败。EnsureStatusIsSuccessful();
语句
您知道如何在开发和生产中解决此问题吗?请查看此网站,并注意他们如何在安全部分下配置此部分
您在配置文件中定义了一个
webHttpBinding
,但您的服务没有使用它,因为您没有在bindingConfiguration
属性中指定它
<service name="abc" >
<endpoint address="http://localhost:8741/LTLInboundService/"
binding="webHttpBinding"
behaviorConfiguration="WebHttpBehaviour" contract="abc"
name="webHttpBinding_LTLInboundService" >
</endpoint>
</service>
因此,您定义的端点将使用指定绑定的值,而不是默认值
最终端点如下所示:
<service name="abc" >
<endpoint address="http://localhost:8741/LTLInboundService/"
binding="webHttpBinding"
bindingConfiguration="webHttpBinding_LTLInboundService"
behaviorConfiguration="WebHttpBehaviour" contract="abc"
name="webHttpBinding_LTLInboundService" >
</endpoint>
</service>
我在同一个wcf项目下创建了多个服务,它们都在Global.asax.cs文件中动态启动..请帮助..感谢您应该显示您在.asax.cs文件中的代码签出此帖子查看adriano repetti
回答您熟悉Proxy的帖子吗与Proxy server authentica相关错误代码为407…我收到RequestEntityTooLarge错误代码(413)…是大文件导致小文件无法正常工作:(有没有一种方法可以通过执行缓冲区Chuncks来流式处理大文件?可能是这样做的,现在出现以下错误..服务启动..System.ServiceModel.dll中发生了类型为'System.ArgumentException'的未处理异常其他信息:提供的URI方案'http'无效;应为'Httpsy您定义的绑定h'将安全模式设置为传输-使用https
或将安全模式设置为无。
<service name="abc" >
<endpoint address="http://localhost:8741/LTLInboundService/"
binding="webHttpBinding"
behaviorConfiguration="WebHttpBehaviour" contract="abc"
name="webHttpBinding_LTLInboundService" >
</endpoint>
</service>
bindingConfiguration="webHttpBinding_LTLInboundService"
<service name="abc" >
<endpoint address="http://localhost:8741/LTLInboundService/"
binding="webHttpBinding"
bindingConfiguration="webHttpBinding_LTLInboundService"
behaviorConfiguration="WebHttpBehaviour" contract="abc"
name="webHttpBinding_LTLInboundService" >
</endpoint>
</service>