Search This Blog

Saturday, August 15, 2009

Checklist for web services

Design Considerations
Check Description

Design chunky interfaces to reduce round trips.

Prefer message-based programming over remote procedure call (RPC) style.

Use literal message encoding for parameter formatting.

Prefer primitive types for Web service parameters.

Avoid maintaining server state between calls.

Consider input validation for costly Web methods.

Consider your approach to caching.

Consider approaches for bulk data transfer and attachments.

Avoid calling local Web Services.
Connections
Check Description

Configure the maxconnection attribute.

Prioritize and allocate connections across discrete Web services.

Use a single identity for outbound calls.

Consider UnsafeAuthenticatedConnectionSharing with Windows Integrated Authentication.

Use PreAuthenticate with Basic authentication.
Threading
Check Description

Tune the thread pool using the formula for reducing contention.

Consider minIoThreads and minWorkerThreads for intermittent burst load.
One Way (Fire and Forget) Communication
Check Description

Consider using the OneWay attribute if you do not require a response.
Asynchronous Web Methods
Check Description

Use asynchronous Web methods for I/O operations.

Do not use asynchronous Web methods when you depend on worker threads.
Asynchronous Invocation
Check Description

Consider calling Web services asynchronously when you have additional parallel work.

Use asynchronous invocation to call multiple unrelated Web services.

Call Web services asynchronously for UI responsiveness.
Timeouts
Check Description

Set your proxy timeout appropriately.

Set your ASP.NET timeout greater than your Web service timeout.

Abort connections for ASP.NET pages that timeout before a Web services call completes.

Consider the responseDeadlockInterval attribute.
WebMethods
Check Description

Prefer primitive parameter types.

Consider buffering.

Consider caching responses.

Enable session state only for Web methods that need it.
Serialization
Check Description

Reduce serialization with XmlIgnore.

Reduce round trips.

Consider XML compression.
Caching
Check Description

Consider output caching for less volatile data.

Consider providing cache-related information to clients.

Consider perimeter caching.
State Management
Check Description

Use session state only where it is needed.

Avoid server affinity.
Attachments
Check Description

Prefer Base64 encoding. Direct Internet Message Encapsulation (DIME) is a supported part of Web Services Enhancements (WSE), but Microsoft® is not investing in this approach long-term. DIME is limited because the attachments are outside the SOAP envelope.
COM Interop
Check Description

Avoid single-threaded apartment (STA) COM objects.