Summary


In this chapter, you learned that Web services use an XML schema in their WSDL documents to dictate the shape and content of the request and response messages to the methods they expose. This schema document is written to a W3C standard and allows you to strongly type each element in the message in a platform-independent way. This means you can avoid type clashes when Web services and their clients are on different platforms.

You also learned that you can incorporate schemas into your .NET XML Web Services in two ways:

  • You can design your messages, write the schemas for them, and then use xsd.exe or wsdl.exe to generate classes that you can incorporate into your code.

  • You can start with code and use .NET’s serialization attributes to adjust the schema that is autogenerated for you into something closer to what you want.

You also learned that the serializer built into the Web method API—found in the System.Xml.Serialization namespace—doesn’t always maintain the schema you intended and that it sometimes trips up on .NET classes you want to use.

If you use the Handler API, you can implement your own serialization routines and use your own specific schemas. If you use the serializer found in the System.Runtime.Serialization namespace, you can use any .NET class you want in your messages, but you should restrict yourself to a .NET-only environment.




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