i have a simple WCF with a couple of methods, the first is: GetDetails, this method, return me some informations and a couple of images in a byte array (all of this in a XML document), but i have a problem:
when i try to call this method:
using (testWCF wcfClient = new testWCF()) { //new testWCF() has no parameter costructors, so i can't use bindings or different endpoint...Why?...anyway
string ff = wcfClient.GetDetails ("Test");
}
The debugger throw me a new exception: (413) Request Entity Too Large
...This is strange, because in the web.config, the configuration seems good:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<compilation targetFramework="4.0"/>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers>
</roleManager>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<!-- Quando si distribuisce il progetto della libreria di servizi, è necessario aggiungere il contenuto del file di configurazione al file
app.config dell'host. System.Configuration non supporta i file di configurazione delle librerie. -->
<system.serviceModel>
<services>
<service name="WCF">
<endpoint address="http://10.10.10.1/wcf/WCF.svc" binding="basicHttpBinding" contract=“wcfContract” bindingConfiguration="MyBindingConfig" behaviorConfiguration="SingleFileBehaviour"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="MyBindingConfig" textEncoding="utf-8" openTimeout="00:02:15" closeTimeout="00:02:15" sendTimeout="00:00:15" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="SingleFileBehaviour">
<wsdlExtensions singleFile="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<extensions>
<behaviorExtensions>
<add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=2.4.0.6, Culture=neutral, PublicKeyToken=f8633fc5451b43fc"/>
</behaviorExtensions>
</extensions>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
</configuration>
Please, help me, i'm struggling on this.
Thanks.