Webservice as a new technology appears in front of us, it's birth are used to address different applications platform synergy. At present, almost every vendor should go Webservice application development, but if the lack of a deeper understanding of Webservice, not very good at the design stage of a good deal with a number of important questions, then finally completed system must be inefficient, there is no reliability of Product .
Webservice in the design application, the following points must be taken into account:
l manage systems and external relations
l grasp the underlying transmission model
l and application of the provision of suitable security policy
l planned deployment related matters
Below on these design-related needs and some common patterns are Webservice model can be applied to start the detailed discussion. During the discussion, you will find Webservice this new technology is how our software development in the past combining.
l standard provides a synergistic capacity
Webservice a basic purpose is to provide various different platforms at different applications the ability to work together.
In order to make a company's network applications to achieve the highest efficiency, the existence of its own and its partners, suppliers and customers between the Webservice, should be able to achieve seamless interaction. If at large should not relaxed between Webservice achieve interactive, then the application efficiency will be greatly reduced. However, in reality, such cases are very likely to arise. Because of all the company's understanding of the business are different, is to understand the same case, the same concept may also be in different forms of performance, specifically in respect of the same data is possible to take a different xml express. Because of the above reasons, the question of synergy should be applied in the design of architecture to be considered when, rather than later to change.
Webservice mainly by following a few posed by technology, SOAP (Simple Object Access Protocol), WSDL (Web service Description Language), and UDDI (Universal Description, Discovery and Integration).
We will not go in here a detailed study of these technologies, but rather to reveal some of their important characteristics, these characteristics need to design Webservice careful consideration.
WSDL is the key to achieve synergy, which provides a contract for the application of old and new interaction between. This technology enables organizations to develop standards may be concentrated in the Service's external interface, without considering the specific implementation organizations. In short, it implements the Webservice interface and implementation separation. So that standards, much easier. And, based on the interface description, a lot of tools can automatically generate client-side code, reducing the workload of developers and make the majority of developers out of the preparation process SOAP messaging code.
SOAP implementation in various Webservice are passed between components of the message transport layer. Therefore, SOAP should be a transparent and collaborative technologies. However, because a lot of implementation of the SOAP method with the standard runs counter to, or add new extensions or deletion of a number of standard features. Because of the support of the SOAP standard in varying degrees, the ability to greatly Webservice synergy, achieve increased coordination difficult. Based on this situation, when the developers Webservice required to run on different platforms at the time, it is necessary to know the specific situation and the corresponding code to resolve this inconsistency. If all of the SOAP implementation organizations are able to follow the standard, then Webservice developers do not need to consider the use of the underlying platform for the Webservice.
Nevertheless, the synergy of different SOAP implementation is still quite difficult, because synergy standards exist many differences, some organizations are committed to standards, such as And . However, only now Webservice development for different platforms, to give a different implementation, making the development of increased costs and burdens.
l understand the transmission model
SOAP is not a completely transparent solution, it put some complex implementation details hidden. Webservice developer must be a deeper understanding of SOAP, the underlying transport mechanism know as well as the model, and thus know how the implementation of SOAP. In some simple applications, some tools can help developers Webservice generate SOAP messaging code, but only in the most simple and effective applications. The situation can not really as simple as possible in some areas you need to have special treatment (at the actual development of such a situation is common), this time, you will need to directly manipulate the SOAP messaging code, as well as some the bottom of the XML content. Therefore, Webservice developer required SOAP and XML-depth understanding of the content layer.
Webservice interface developed at the time, not to think that the use of XML technology, collaborative problem solved, XML is not a panacea to solve integration issues. Here same standards required, at the industry recognized the need for a glossary. Only at the design of the framework you introduce XML technology and can not guarantee that system synergy, XML is only the language used to describe data, XML itself does not provide semantic data to understand. Like English and German use the Latin alphabet, but their semantics are not the same.
Even if you use the same language, there is no guarantee of a good collaboration. Companies such as you describe a possible use of Order Order, but you probably use a partner Purchase_Order, while the other partner is not the same as possible. You can not force all of your partners and you use the same vocabulary. Therefore there is a necessary technology at large to serve as the translation between the description of role. XSLT is a technology so that it used different language conversion. And the use of XML with XSLT in order to solve the coordination problem.
l DOM vs. SAX
Webservice much of the development environment, will develop from the bottom of the XML document parsing and deal with emancipated, they provide a very convenient automation or instrument, making the process very easy. However, some have special requirements Webservice applications, such as the need for better flexibility or special high-speed applications, will need to manually deal with XML documents. At this time two types of XML parsing model-DOM and SAX choice, will become important issues.
DOM tree using XML documents analytic way, and more using SAX is event-driven model.
DOM first mapping XML documents into a tree, and then through the use of a wide range of tree related operations to deal with this document. This approach has a lot of benefits, first of all, developers can easily understand that the use of a tree which developers are the most common economical. The most commonly used XML in the DOM Medium Service required frequent modifications occasions. DOM of course, also has its disadvantage, in dealing with XML documents, it required loading the entire document, regardless of whether you need to modify one of only a small part. So its operating efficiency as well as the use of memory is obviously unacceptable, especially in the face of a lot of XML documents.
SAX event-driven model used to deal with XML documents. Through a series of events to trigger, to complete the analysis of XML, you can only care about you to deal with the case, when these incidents occur, will call to the appropriate callback function to notify to you. Such an approach can largely enhance the efficiency of parsing XML documents. But its disadvantage is difficult to use, as well as several times the same document will deal with some problems.
All in all, DOM a more suitable deal with the kind of document-based XML documents, SAX is suitable for the kind and want to map directly to the XML structure into you at an object of the system's operation. (Such as the structure of an XML direct mapping into a JAVA Medium Class), or the kind of XML document for Tag special operation.
l document exchange vs. RPC model
These two interactive applications should be at the initial architecture design should be carefully considered, because it will largely determine the degree of system coupling.
RPC (Remote Procedure Call) is essentially a remote method call. Even though Webservice is based on XML but you can still use Remote Method Invocation Webservice this model to carry out the implementation, especially the kind of easy at the request of the corresponding model. In the process, the transmission of XML documents are described in more information on the remote methods, such as method name, method parameters and so on.
And document exchange, compared with the RPC at XML file instead of mapping to do remote method, but a complete self-contained business documents, when the Service client received the document, the first pre-processing (such as vocabulary Translation and mapping), and then construct a message back. The return message tectonic process, is often no longer be a simple method call, but a number of objects to complete a collaborative deal with affairs, and then return the results.
The difference between these two methods, similar to phone calls and e-mail the different methods of treatment. At present, for the first method provides a lot of automated tools make remote method calls can be very easy to complete, then the lack of a way to support a range of tools, required the developer to complete manually.
Nevertheless, at this or recommend the use of document exchange. Because it has the RPC in the following areas do not have advantages.
The use of the document the way you can take full advantage of XML files to describe and validate a business document, and in the RPC model is only being used to describe XML methods.
The use of the document the way customers at the Service provider is no longer required between the close agreement, while the RPC model and required client Service providers are closely linked, once the method of change, the client will need to make corresponding changes. This does not conform to the requirements of low-coupling system, and in the document exchange in the many flexible.
Because of business data are self-contained, it is clear the document model is more conducive to the use of asynchronous processing.
l the use of design patterns
Design patterns at design time Webservice obviously can play a considerable role. The main purpose of design patterns is to resolve some in similar circumstances have been similar questions to provide more sophisticated design. Here, only a simple reference to some very commonly used mode, let us understand that the mode can be played at Webservice role.
Adapter: for internal systems to provide a different interface
Façade: the complexity of the internal implementation package, providing a series of simple interface
Proxy: a proxy for other objects in place of its service delivery
Adapter pattern is used to a component interface into a client needed to look like, here is the customer Webservice. A common situation is that the original packaging of the old system into a Webservice. For instance is using J2EE platform, while the original has a C + + implementation of the system, certain functions, it now needs to be released into Webservice, then use JNI technology necessary to do an Adapter, as the original C + + components to provide a Java - interface, and then into a Webservice.
Façade pattern used to build coarse-grained services, which packed a fine-grained services, complex systems so as to provide an easy interface. J2EE at Medium, Session Bean as a Façade, and the Entity Bean is a fine-grained services. Webservice also at the same, the use of Façade pattern can have the function of components exert obliterated.
Proxy mode for the agent to act as other objects, similar to the role of intermediaries to deal with job transfer from one object to another object. At Webservice, it is mainly used to hide message Soap tectonic process. Can also be used to simulate the object (Mock Object) creation.
The above are only some can be used to Webservice development model, if you will be skilled Webservice applies to the development of these models, you will find Webservice application development will be to do if a special kind of object-oriented design.
l Security
Webservice as a convenient service to be used by broad field, it also became the hackers food. Here, this paper will present Webservice security can do to improve the introduction easy to do.
Webservice security at the main divided into the following three aspects.
Transfer SSL / HTTPS encryption for the connection, rather than transferring data
Message data encryption (XML Encryption) Digital Signature (XML-DSIG)
Architecture underlying the use of application service security mechanism
Transmission security are most likely to be added to your Webservice applications, using the existing SSL and HTTPS protocol, you can easily get connected in the process of security.
However, this method of security implementation has two weaknesses. First, it can only guarantee the security of data transmission rather than data for their own safety, data, once they arrived in a certain place, it can be viewed by any person. In Webservice, the data may arrive in more than a place, and this data is not the be all of the recipients of the Show. Second, it provided there is either yes or no full-protection, you should not select which part of the data to be protected, which is also optional at Webservice in regular use to.
Second layer of protection is the protection for the message itself. You can use the expansion of existing XML security standards, realize the functions of digital signature, thus ensuring that the message you are from a particular party has not been modified. XML document encryption technology on a greater extent from the enhanced security Webservice it to be able to customize data transmission, whether it can be read by the recipient, and further improve the security of the transmission, the industry has been the safety of the formulation Webservice standards such as SAML and WS-Security.
Finally a layer of protection is to rely on the underlying architecture of security, this is more from the operating system, middleware and some protection. Such as in J2EE, the chair Webservice application server. At present, much of J2EE application servers support the Java Authentication and Authorization Service (JAAS), This is has recently been added to the J2SE 1.4 which. Webservice use the auspices of the server, some security mechanism to achieve this is a very natural approach. Another use of the underlying security architecture approach is to do an independent server is responsible for safety, Webservice create users and are required to obtain security with confidence.
Recommend Information







