Featured post
c# - WCF - maxReceivedMessageSize -
i have problem setting maxreceivedmessagesize
larger files.
i'm getting:
the maximum message size quota incoming messages (65536) has been exceeded. increase quota, use maxreceivedmessagesize property on appropriate binding element.
here server side configuration:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="httpbaseaddress" value="http://localhost:8080/welcomemessage/"/> <add key="httpfiletransferaddress" value="http://localhost:8080/filetransfer/"/> </appsettings> <system.web> <compilation debug="false" /> </system.web> <system.webserver> <modules runallmanagedmodulesforallrequests="true"/> </system.webserver> <system.servicemodel> <services> <service name="fs.services.messageservice" behaviorconfiguration="myservicetypebehaviors"> <endpoint contract="fs.interfaces.imessageservice" address="" binding="wshttpbinding"/> </service> <service name="fs.services.filetransferservice" behaviorconfiguration="myservicetypebehaviors"> <endpoint contract="fs.interfaces.ifiletransferservice" address="" binding="basichttpbinding" bindingconfiguration="streamedhttpbinding"/> </service> </services> <bindings> <basichttpbinding> <binding name="streamedhttpbinding" messageencoding="text" transfermode="streamed" maxreceivedmessagesize="400000000"/> </basichttpbinding> </bindings> <behaviors> <servicebehaviors> <behavior name="myservicetypebehaviors"> <servicemetadata httpgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="false" /> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> </configuration>
here client side configuration:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <client> <endpoint address="" binding="wshttpbinding" contract="fs.services.imessageservice" name="fs.services.messageservice" /> <endpoint address="" binding="basichttpbinding" bindingconfiguration="streamedhttpbinding" contract="fs.services.ifiletransferservice" name="fs.services.filetransferservice" /> </client> <bindings> <basichttpbinding> <binding name="streamedhttpbinding" maxreceivedmessagesize="400000000" messageencoding="text" transfermode="streamed"/> </basichttpbinding> </bindings> </system.servicemodel> </configuration>
this how connect client:
basichttpbinding binding2 = new basichttpbinding("streamedhttpbinding"); endpointaddress endpoint2 = new endpointaddress("http://localhost:8080/filetransfer"); channelfactory<ifiletransferservice> channelfactory2 = new channelfactory<ifiletransferservice>(binding2, endpoint2); ifiletransferservice proxy2 = channelfactory2.createchannel(); ((iclientchannel)proxy2).open();
also transfer type of files 500mb using stream messages. can please provide me configuration (or solution) support that?
thanx!
your client side config doesn't have <client>
tag reference server, , apply binding configuration increased message size......
on server side, need define service , endpoints:
<services> <service name="yournamespace.yourserviceclass"> <endpoint name="endpoint1" address="http://server:8888/yourservice.svc" binding="basichttpbinding" bindingconfiguration="lagemessagetransfer" contract="iyourservicecontract" /> </service> </services>
on client side, need define client endpoint connecting 1 of service endpoints
<client> <endpoint name="default" address="http://server:8888/yourservice.svc" binding="basichttpbinding" bindingconfiguration="lagemessagetransfer" contract="iyourservicecontract" /> </client>
update: ok, see config fine - where client endpoint connecting to?? don't have address=
defined!
<client> <endpoint name="fs.services.filetransferservice" address="" binding="basichttpbinding" bindingconfiguration="streamedhttpbinding" contract="fs.services.ifiletransferservice" /> </client>
- Get link
- X
- Other Apps
Comments
Post a Comment