开发者

WCF WebService. Does not allow sending more than 8kb of data

开发者 https://www.devze.com 2022-12-22 19:27 出处:网络
I have developed a WCF WebService. On client side they are unable to send more than 8kb of file bytes[]. How can I increase the number of bytes the client and upload and also the time out.

I have developed a WCF WebService. On client side they are unable to send more than 8kb of file bytes[]. How can I increase the number of bytes the client and upload and also the time out.

<system.serv开发者_JAVA百科iceModel>
    <!-- Test File Size  -->
    <binding maxReceivedMessageSize="2147483647">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" >
    </binding>

        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
        <services>
            <service name="WcfSmartConnect.Service1" behaviorConfiguration="WcfSmartConnect.Service1Behavior">
                <!-- Service Endpoints -->
                <endpoint address="" binding="wsHttpBinding" contract="WcfSmartConnect.IService1">
                    <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
                    <identity>
                        <dns value="localhost"/>
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="WcfSmartConnect.Service1Behavior">
                    <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                    <serviceMetadata httpGetEnabled="true"/>
                    <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                    <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>


Maybe not a direct answer but for large files you really should be looking at MTOM or streaming.


add this to the endpiont tag:

bindingconfiguration="wsHttp"

than add this complete binding config tag inside your system.serviceModel tag

<binding name="wsHttp" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" >
</binding>
0

精彩评论

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