Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My Server Config:
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <system.serviceModel>
- <services>
- <service name="[my-service-name]">
- <endpoint address="http://localhost:8005/MyService"
- binding="webHttpBinding"
- contract="[my-service-contract-name]"/>
- </service>
- </services>
- <bindings>
- <basicHttpBinding>
- <binding maxReceivedMessageSize="2147483647"
- maxBufferSize="2147483647"
- maxBufferPoolSize="2147483647">
- <readerQuotas maxDepth="32"
- maxArrayLength="2147483647"
- maxStringContentLength="2147483647"/>
- </binding>
- </basicHttpBinding>
- </bindings>
- <behaviors>
- <serviceBehaviors>
- <behavior>
- <serviceMetadata httpGetEnabled="true"/>
- <serviceDebug includeExceptionDetailInFaults="true"/>
- <dataContractSerializer maxItemsInObjectGraph="2147483647" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
- </startup>
- </configuration>
- My Service:
- [OperationContract]
- [WebInvoke(Method = "POST", UriTemplate = "MyService")]
- void MyService(String input)
- {
- Console.WriteLine("Request data = " + input.Length);
- }
- Client Config:
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
- </startup>
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="name-here" maxReceivedMessageSize="2147483647">
- </binding>
- </basicHttpBinding>
- </bindings>
- <behaviors>
- <serviceBehaviors>
- <behavior name="behavior-here">
- <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- In your config, please add
- "<dataContractSerializer maxItemsInObjectGraph="2147483647"/>"
- Service Config:
- <behaviors>
- <serviceBehaviors>
- <behavior>
- <serviceMetadata httpGetEnabled="true"/>
- <serviceDebug includeExceptionDetailInFaults="true"/>
- <dataContractSerializer maxItemsInObjectGraph="2147483647" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- Client Config:
- <behaviors>
- <serviceBehaviors>
- <behavior name="MyServiceBehavior">
- <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
- </behavior>
- </serviceBehaviors>
- </behaviors>
Add Comment
Please, Sign In to add comment