Summary

By now, you should be able to shape your WSDL to do anything you want. Not only can you change the name of almost all the pieces in the WSDL file, but you can split it up at will or cause other WSDL documents to be referenced by your Web Service. As for shaping the physical message, you can now apply many of the SOAP attributes to affect what the message looks like. The attributes covered in this chapter and the parts they affect are listed in Table 4.1 for your convenience. If you need extra functionality, write a custom SOAP extension. Finally, you know how easy it is to register a Web Service with Microsoft's UDDI registry.

Table 4.1. Attributes Covered in this Chapter and What They Affect
Classname (can appear in code without the final Attribute part of the name) Affected parts of WSDL
SoapDocumentServiceAttribute Specifies document/literal encoding. Influences type layouts.
SoapDocumentMethodAttribute Sets method name, binding information, request, and response information for document/literal SOAP methods.
SoapElementAttribute Specifies how to serialize an element within a SOAP message.
SoapEnumType Specifies how to represent an enum value within a SOAP message.
SoapHeaderAttribute Specifies a Header to use with a given message.
SoapIgnoreAttribute Tells the XML serializer to not include a particular element when transforming an object to XML.
SoapRpcMethodAttribute Sets method name, binding information, request, and response information for RPC/encoded SOAP methods.
SoapRpcServiceAttribute Specifies RPC/encoded encoding. Influences type layouts.
SoapTypeAttribute Allows the developer to specify namespace, type, and element name information when serializing data as a SOAP message.
WebMethodAttribute Exposes a Public Sub or Function as a part of a Web Service. Also associates a method with a particular binding.
WebServiceAttribute Allows code to set default namespace for the Web Service. Also sets documentation within the service element.
WebServiceBindingAttribute Declares binding separation as well as the binding namespace. If the binding data exists in a separate file, this attribute also allows the code to declare the location of that file.
XmlAttributeAttribute When serializing data as XML, this attribute declares that the element itself should appear as an XML attribute. Can also set the name and namespace of the attribute.
XmlElementAttribute When serializing data as XML, this attribute declares that the element itself should appear as an XML element. Can also set the name and namespace of the element.
XmlEnumAttribute When representing the value in an enumeration, this attribute allows the code to declare the namespace and representation of that value in the XML version of the enumeration.
XmlTypeAttribute When representing a class or struct as XML, this attribute allows the code to declare the namespace and name of that class when represented as XML.

Knowing how to use this information should allow you to create Web Services that operate well with other SOAP toolkits. You should be able to mold your client code as well because these same attributes shape both the WSDL and the SOAP message. Occasionally, you will come across WSDL documents that contain errors or other sources of incompatibilities. With the information in this chapter and having a copy of a valid message exchange on hand, you should be able to write your own proxies if the need arises.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.133.54