Hej
Jeg har et par problemer med consuming af en WCF-Service til et Silverlight projekt.
Problem #1: maxReceivedMessageSize.
Selvom jeg konfigurerer servicen til, at kunne modtage filer på omkring 2 gb (max størrelse), så er størrelsen under runtime stadig omkring 65000 kb.. hvad har jeg gjort galt i konfgurationen?
- <configuration>
- <system.serviceModel>
- <bindings>
- <customBinding>
- <binding name="AdmBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00">
- <binaryMessageEncoding maxReadPoolSize="20971520" maxWritePoolSize="20971520" maxSessionSize="20971520">
- <readerQuotas maxArrayLength="20971520" maxDepth="20971520" maxStringContentLength="20971520" maxBytesPerRead="20971520" maxNameTableCharCount="20971520" />
- </binaryMessageEncoding>
- <httpTransport maxReceivedMessageSize="20971520" maxBufferSize="20971520" />
- </binding>
- </customBinding>
- <mexHttpBinding>
- <binding name="" />
- </mexHttpBinding>
- </bindings>
- <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
- <services>
- <service name="Adm">
- <endpoint binding="customBinding" bindingConfiguration="AdmBinding" contract="Adm" />
- <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="" />
- <host>
- <baseAddresses>
- <add baseAddress="http://localhost:81/Services/Adm.svc" />
- </baseAddresses>
- </host>
- </service>
- </services>
- <behaviors>
- <serviceBehaviors>
- <behavior>
- <serviceMetadata httpGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="true" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- </configuration>
Den finder fint min service, der er andre metoder der virker, men lige så snart jeg skal sende filer til den, smider den en exception: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Problem #2: HTTPS
Jeg har også forsøgt at få servicen til at køre på HTTPS i stedet, men det er ligeledes uden held.
Selvom jeg har nogenstående konfiguration, bliver den ved med at kalde servicen på http.
- <configuration>
- <system.serviceModel>
- <bindings>
- <customBinding>
- <binding name="AdmBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00">
- <binaryMessageEncoding maxReadPoolSize="20971520" maxWritePoolSize="20971520" maxSessionSize="20971520">
- <readerQuotas maxArrayLength="20971520" maxDepth="20971520" maxStringContentLength="20971520" maxBytesPerRead="20971520" maxNameTableCharCount="20971520" />
- </binaryMessageEncoding>
- <httpsTransport maxReceivedMessageSize="20971520" maxBufferSize="20971520" authenticationScheme="None" />
- </binding>
- </customBinding>
- <mexHttpsBinding>
- <binding name="" />
- </mexHttpsBinding>
- </bindings>
- <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
- <services>
- <service name="Adm">
- <endpoint binding="customBinding" bindingConfiguration="AdmBinding" contract="Adm" />
- <endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="" />
- <host>
- <baseAddresses>
- <add baseAddress="https://localhost/Services/Adm.svc" />
- </baseAddresses>
- </host>
- </service>
- </services>
- <behaviors>
- <serviceBehaviors>
- <behavior>
- <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="true" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- </configuration>
Tak for tiden