Modificare nel file app.config il parametro maxReceivedMessageSize come evidenziato qui sotto.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpsEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="HttpsEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://api.dc1.computing.cloud.it/WsEndUser/v2.9/WsEndUser.svc"
binding="wsHttpBinding" bindingConfiguration="HttpsEndpoint"
contract="ServiceWsEndUser.IWsEndUser" name="HttpsEndpoint" />
<endpoint address="https://api.dc1.computing.cloud.it/WsEndUser/v2.9/WsEndUser.svc/soap11"
binding="basicHttpBinding" bindingConfiguration="BasicHttpsEndpoint"
contract="ServiceWsEndUser.IWsEndUser" name="BasicHttpsEndpoint" />
<endpoint address="https://api.dc1.computing.cloud.it/WsCommon/v2.9/WsCommon.svc"
binding="wsHttpBinding" bindingConfiguration="HttpsEndpoint"
contract="ServiceWsCommon.IWsCommon" name="HttpsEndpoint1" />
<endpoint address="https://api.dc1.computing.cloud.it/WsLicense/v2.9/WsLicense.svc"
binding="wsHttpBinding" bindingConfiguration="HttpsEndpoint"
contract="ServiceWsLicense.IWsLicense" name="HttpsEndpoint2" />
</client>
</system.serviceModel>
A questo punto non resta che provare il collegamento alle API modificando il metodo Main del file Program.cs.
using ArubaCloud.ServiceWsCommon;
using ArubaCloud.ServiceWsEndUser;
using ArubaCloud.ServiceWsLicense;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//crea un nuovo oggetto di tipo WsEndUserClient
using (WsEndUserClient client = new WsEndUserClient("HttpsEndpoint"))
{
//crea un nuovo oggetto di tipo WsCommonClient
using (WsCommonClient client = new WsCommonClient())
{
}
//crea un nuovo oggetto di tipo WsLicenseClient
using (WsLicenseClient client = new WsLicenseClient())
}
}
}
}