BasicHttpBinding is utilized for communication as it allows for greatest interoperability. Secure vs. unsecure bindings only differ by the addition of the security node. With the addition of the security node, communication is expected to be with a secured endpoint (https). This means the service must load and utilize a valid SLL certificate.
Secure connections can be set on the ERS or third-party application side, or neither side. For this reason, ClientCredentialType is intentionally set to None.
The following items should also be noted when creating the HTTP binding:
-
maxBufferSize and maxReceivedMessageSize are both set to 5242880(5MB). This ensures the buffers are large enough for messages that contain a large amount of information, but also sets a limit in order to help prevent denial of service attacks.
-
messageEncoding is set to use MTOM, which is the W3C Message Transmission Optimization Mechanism and is a method of efficiently sending binary data to and from Web services.
-
textEncoding is set to UTF-8 because it supports Unicode languages.
-
transferMode is set to Streamed. This allows for large chunks of data (document pages or otherwise) to be streamed from server to client. This helps prevents System.OutOfMemory exceptions due to attempts to buffer large requests in memory.
-
recieveTimeout and sendTimeout are both set to 00:05:00(5 minutes) in an effort to ensure that network latency and business logic have enough time to execute (i.e., it prevents a premature connection timeout because the server is busy).
-
The ReaderQuotas attributes are both set to 32767(32KB) to support long document names and Keyword values.
-
The < security> mode attribute is set to Transport for secure connections. This is the only security that is supported in BasicHttpBinding that also supports streaming.
The clientCredentialType for secure connections is set to None intentionally, since secure connections can be set on the ERS or third-party application side, or neither side.
For more information on BasicHttpBinding, see http://msdn.microsoft.com/en-us/library/ms731361.aspx.