Il servizio WCF ha un OperationContract che accetta come parametro una serie di oggetti. Questo può potenzialmente essere abbastanza grande. Dopo aver cercato le correzioni per Bad Request: 400, ho trovato il vero motivo: la dimensione massima del messaggio.La quota massima delle dimensioni dei messaggi per i messaggi in arrivo (65536) è stata superata
So che questa domanda è stata posta prima in MOLTI luoghi. Ho provato quello che dicono tutti: "Aumenta le dimensioni nei file di configurazione client e server". Io ho. Ancora non funziona. web.config
mio di servizio: app.config
<system.serviceModel>
<services>
<service name="myService">
<endpoint name="myEndpoint" address=""
binding="basicHttpBinding"
bindingConfiguration="myBinding"
contract="Meisel.WCF.PDFDocs.IPDFDocsService" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="myBinding"
closeTimeout="00:11:00"
openTimeout="00:11:00"
receiveTimeout="00:15:00"
sendTimeout="00:15:00"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647"
transferMode="Buffered"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
mio Cliente:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPDFDocsService"
closeTimeout="00:11:00"
openTimeout="00:11:00"
receiveTimeout="00:10:00"
sendTimeout="00:11:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8451/PDFDocsService.svc"
behaviorConfiguration="MoreItemsInObjectGraph"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IPDFDocsService"
contract="PDFDocsService.IPDFDocsService"
name="BasicHttpBinding_IPDFDocsService" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="MoreItemsInObjectGraph">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
cosa posso possibilmente essere mancante o facendo male? È come se il servizio stia ignorando ciò che ho digitato in maxReceivedBufferSize.
Grazie in anticipo, Kyle
UPDATE
Ecco altri due domande StackOverflow dove non hanno mai ricevuto una risposta, sia:
WCF MaxReceivedMessageSize property not taking
Sembra corretto a colpo d'occhio. Stai configurando il punto finale nel codice ovunque? Se è così, potrebbe sovrascrivere le impostazioni di configurazione. –
Come stai ospitando il servizio? IIS? –
@Jeff: Sto solo creando una nuova istanza del mio client di servizio, quindi chiamando OperationContract, passando la mia classe personalizzata come parametro. Nulla di bello. @Simon: sto utilizzando il server di sviluppo ASP .NET. Attualmente è tutto locale. – DaleyKD