Chapter 6: Writing Schemas for Your Services


Overview

Have you ever talked to people with really thick regional accents? They might be offering you a drink, but by the time you realize that, they’ll already have bought themselves a round, missed you out, and it’ll be your turn next.

“England and America are two countries separated by the same language.”

—George Bernard Shaw

As Shaw suggests, there are even larger problems than accent. The word pants, for example, means different things in the United States than in the U.K.; unless you get the context right, your words might be misconstrued.

The same problem happens with Web services. Both client and server speak in SOAP, but they might disagree on the XML grammar used in the message payload— the context, if you will. Fortunately for Web service developers, there’s a way to specify the message’s context as it is sent to and from the client—by writing a schema for the message and obeying the rules that schema lays out.

In this chapter, then, we’ll look at the following topics:

  • The importance of schemas to Web service developers and to communication between client and server

  • The components of a schema and how to write a schema for your messages

  • Incorporating a schema into a Web service

  • Implementing the .NET Framework equivalent of writing a Web service schema explicitly: annotating your classes

Alas for tourists, there’s no real equivalent to a schema for dealing with regional accents or local idioms. Polite laughter and respect for your host are the best you can do to get “back in context.”




Programming Microsoft. NET XML Web Services
Programming MicrosoftВ® .NET XML Web Services (Pro-Developer)
ISBN: 0735619123
EAN: 2147483647
Year: 2005
Pages: 172

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net