Conclusion

Web services are an exciting and powerful technology. By using a distributed, object-oriented model for our application, we can tap into this new technology and still reuse our existing business objects, logic, and data.

In this chapter, we discussed a way of viewing web-services technology as a useful tool in creating an interface to our business objects. This is just another type of interface, on a level with a Windows Forms or Web Forms interface, but instead of being targeted directly at the end user , a web-services interface is targeted at other applications.

We also discussed the fact that a web-services interface, once published, must be viewed as an immutable contract between us and an unknown and unpredictable number of consumers. Any change to our web-method names , parameters, or return types will break consumers. This is complicated when we're dealing with complex data types, because our contract then extends beyond the methods to include the layout of the data we're sending and receiving.

An easy way to define the data layouts for complex data is to use user-defined types, or struct types. These are easy to create, easy to read, and are automatically exposed as part of our web service. This means that consumers can easily determine the data layouts, based on the WSDL definition for our service.

Using all these concepts, coupled with a custom SOAP header to handle security, we implemented a web service containing web methods that expose all the functionality of our business system. Because all of our business logic, including validation and security, is in our business objects, the web methods themselves contain relatively little code.

In Chapter 11, we'll close the book by discussing some ways to do reporting and batch-processing operations in a distributed, object-oriented environment.



Expert C# Business Objects
Expert C# 2008 Business Objects
ISBN: 1430210192
EAN: 2147483647
Year: 2006
Pages: 111

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