Configure WCF RIA Service Endpoint

Can I configure WCF RIA service endpoint settings? In particular, I would like to create a custom binding for the endpoint and increase maxReceivedMessageSize to allow sending the contents of a file of several megabytes in size.

I tried to interfere with web.config, but I get the following error:

[InvalidOperationException]: contract name MyNamespace.MyService could not be found in the list of contracts implemented by MyNamespace.MyService

web.config

 <system.serviceModel> <bindings> <customBinding> <binding name="CustomBinaryHttpBinding"> <binaryMessageEncoding /> <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> </binding> </customBinding> </bindings> <services> <service name="MyNamespace.MyService"> <endpoint address="" binding="wsHttpBinding" contract="MyNamespace.MyService" /> <endpoint address="/binary" binding="customBinding" bindingConfiguration="CustomBinaryHttpBinding" contract="MyNamespace.MyService" /> </service> </services> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> 
+4
source share
1 answer

We had a similar problem: we want to send large fom Silverlight bitmaps to the server by calling the WCF-RIA service.

The following change in Web.config worked for us:

 <httpRuntime requestValidationMode="2.0" maxRequestLength="6225920"/> 

See How to configure the parameter / message length for the WCF-RIA service to work.

0
source

Source: https://habr.com/ru/post/1312581/


All Articles