Skip to Main Content
Programming WCF Services
book

Programming WCF Services

by Juval Lowy
February 2007
Intermediate to advanced content levelIntermediate to advanced
634 pages
16h 1m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services

Essentials

  1. Place service code in a class library and not in any hosting EXE.

  2. Do not provide parameterized constructors to a service class unless it is a singleton that is hosted explicitly.

  3. Enable reliability in the relevant bindings.

  4. Provide a meaningful namespace for contracts. For outward-facing services, use your company’s URL or equivalent URN with a year and month to support versioning; for example:

    [ServiceContract(Namespace = "http://www.idesign.net/2007/08")]
    interface IMyContract
    {...}

    For intranet services, use any meaningful unique name, such as MyApplication; for example:

    [ServiceContract(Namespace = "MyApplication")]
    interface IMyContract
    {...}
  5. With intranet applications on Windows XP and Windows Server 2003, prefer self-hosting to IIS hosting.

  6. On Windows Vista, prefer WAS (IIS7) hosting to self-hosting.

  7. Use ServiceHost<T>.

  8. Enable metadata exchange.

  9. Always name all endpoints in the client config file.

  10. Do not use SvcUtil or Visual Studio 2005 to generate a config file.

  11. Do not duplicate proxy code. If two or more clients use the same contract, factor the proxy to a separate class library.

  12. Always close or dispose of the proxy.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming WCF Services, 3rd Edition

Programming WCF Services, 3rd Edition

Juval Lowy
Mastering ASP.NET Web API

Mastering ASP.NET Web API

Mithun Pattankar, Malendra Hurbuns

Publisher Resources

ISBN: 0596526997Supplemental ContentErrata Page