Traditional Culture Encyclopedia - Traditional stories - Traditional enterprise application integration

Traditional enterprise application integration

What are SOA and SOAP?

What exactly is SOA?

The definition of SOA (service-oriented architecture) is a service-oriented architecture, that is to say, software is designed as services according to functions, and these services define interfaces in a standard way and are called through standard protocols. The interface and calling method defined by SOA are independent of programming language and running platform. Generally speaking, SOA can be implemented based on different underlying technologies, such as CORBA and Web services. However, CORBA is too complicated and bloated to be used, so most SOA mentioned at present is based on Web service technology. Under the realization of Web services, the interface of SOA services is defined by XML.

Under the framework of SOA, software development starts with business process analysis, uses the method of component business modeling to identify and analyze various business models, and integrates various practices into them. On this basis, use cases are established, which directly generate BPEL and can be integrated into a service integration framework, which describes the information of various services, thus unifying all modules on ESB and forming a huge service warehouse.

Separate the middle layer, and make a cross-technology architecture metadata and business logic in the middle layer, so as to make it a cross-technology architecture, long-term inheritance and continuous accumulation of enterprise business library and the most valuable information asset, that is, service-oriented component library, and this service component library can also be reused by other enterprises without relying on any kind of technology architecture. Exaggerated, if all software enterprises use SOA architecture, the world software industry will be completely changed. Obviously, such a framework is not a product, nor is it just a technology, but a methodology to solve problems.

SOA may be suitable for two scenarios: the first is business interconnection; The second is a closed trading system, which separates metadata from business logic and forms reusability. For example, in the first scenario, when businesses between different enterprises need to call each other, SOA technology may be adopted at this time; In the second scenario, when the system needs to migrate within the enterprise, the original data and business processes defined by SOA technology can be completed quickly.

SOA is not a new thing. Over the years, IT organizations have successfully established and implemented SOA application software. BEA, IBM and other manufacturers saw its value and followed suit. The goal of SOA is to make it more flexible, respond to the needs of business units faster, and realize real-time enterprise (this is Gartner's vision goal for SOA). As early as June 20001year, Rhonda of BEA proposed to transform BEA's IT infrastructure into SOA, and achieved good results in controlling the whole enterprise architecture, improving development efficiency, speeding up development, reducing customization and personnel skill input.

SOA is a specification for designing, developing, applying and managing distributed logic (service) units in a computing environment. This definition determines the universality of SOA. SOA requires developers to design application software from the perspective of service integration, even if the benefits of doing so are not immediately apparent. SOA requires developers to go beyond application software, consider reusing existing services, or check how to reuse services. SOA encourages the use of alternative technologies and methods, such as messaging mechanisms, to build applications by linking services together instead of writing new code. After an appropriate framework, the application of this message mechanism enables companies to quickly respond to changing market conditions within the time allowed by the business environment only by adjusting the original service model instead of being forced to develop large-scale new application code.

SOA is more than just a development method-it also includes management. For example, after applying SOA, managers can conveniently manage these enterprise applications built on service platforms instead of managing individual application modules. The principle of SOA is that by analyzing the mutual calls between services, it is convenient for company managers to obtain the data information of when, why and which business logics were executed, thus helping enterprise managers or application architects to iteratively optimize their enterprise business processes and application systems.

A central idea of SOA is to make enterprise applications get rid of the shackles of technology-oriented solutions and easily meet the changing and developing needs of enterprise business services. A single application in an enterprise environment cannot meet the needs of business users. Even a large-scale ERP solution can't meet the gap of expanding and changing demand and respond to the market quickly. Business users can only support their existing business needs by constantly developing new applications and expanding existing applications. By focusing on services, applications can be centralized to provide richer and more purposeful business processes. Therefore, enterprise application system based on SOA usually reflects the combination with business model more truly. Services look at technology from the perspective of business processes-this is top-down. This view is contrary to the general business view driven by available technologies. The advantages of services are obvious: they are combined with business processes, so they can represent business models more accurately and support business processes better. On the contrary, we can see that the application-centric enterprise application model forces business users to limit their capabilities to those of the application.

Enterprise process is the air flowing through the enterprise framework, which gives life to the components in the business model and defines their relationships more clearly. Processes define specialized methods for interacting with business models. For example, accounting may be an integral part of an enterprise service system, but sending invoices to customers is a business process. Services are defined to support business processes, so what runs through the whole process is the assembly operation and logical realization of various service components in the process. Understanding business processes is the key to customizing services.

Traditional application integration methods (point-to-point integration, enterprise message bus or middleware integration (EAI), business process-based integration) are complex, expensive and inflexible. These integration methods are difficult to quickly adapt to the growing demand based on the changes of modern business of enterprises. Application development and integration based on service-oriented architecture (SOA) can solve many such problems.

SOA describes a set of perfect development patterns to help client applications connect to services. These patterns customize a series of mechanisms for describing services, notifying and discovering services, and communicating with services.

Different from the traditional application integration method, in SOA, all patterns around services are realized by standards-based technologies. So do most communication middleware systems, such as RPC, CORBA, DCOM, EJB and RMI. However, their implementation is not perfect, and there are always problems in weighing the interactivity and acceptability of standard customization. SOA tries to eliminate these defects. Because almost all communication middleware systems have fixed processing modes, such as RPC functions, CORBA objects and so on. However, services can be defined as functions and objects, applications and so on. This makes SOA applicable to any existing system, and makes it unnecessary for the system to deliberately follow any special customization when integrating.

SOA helps enterprise information systems migrate to the "off-tier" architecture, which means that systems can provide Web service interfaces without modifying existing enterprise systems. Because they have been encapsulated by application layers that can provide Web service interfaces, SOA can quickly transform systems and applications into services without modifying the existing system architecture. SOA includes not only information from packaged applications, customized applications and legacy systems, but also functions and data from IT architecture, such as security, content management and search. Because SOA-based applications can easily add functions from these basic service architectures, SOA-based applications can respond to market changes more quickly and design and develop new functional applications for enterprise business departments.

What is soap?

SOAP is short for Simple Object Access Protocol.

SOAP is a lightweight information exchange protocol based on XML in distributed environment.

Understanding of Soap:

The first step is to understand: soap = http+XML.

The second step is understanding: SOAP encodes the use of XML into the encoding method of request and response parameters, and uses HTTP as the transmission method.

SOAP combines the mature WEB technology based on HTTP with the flexibility and extensibility of XML.

Step 3: Understand: Specifically, the SOAP implementation can be simply regarded as an HTTP request and response following the SOAP encoding rules.

Note: SOAP is a protocol independent of programming language. In fact, many languages have started to support SOAP, such as Java, C, c++ and JavaScript.

The origin of soap? The problem solved by Soap?

SOAP was originally initiated by Microsoft to solve the problems of large resource consumption and lightweight of MTS/COM. Later, it was gradually accepted by giants such as IBM and joined the research. Now it has been submitted to W3C, which has become the transmission standard of Web service applications. SOAP technology is mainly used to realize the interoperability between a large number of heterogeneous programs and platforms, so that existing applications can be accessed by a wide range of users.

SOAP stands for Simple Object Access Protocol. Indeed, as its name implies, SOAP is very simple. It is an XML-based protocol that allows program components and applications to communicate with each other using the standard Internet protocol HTTP. SOAP is an independent platform, independent of programming language. It is simple, flexible and easy to expand. At present, applications can communicate with each other using Remote Procedure Call (RPC) based on DCOM and CORBA technology, but HTTP is not designed for this purpose. The application of RPC on the Internet is very difficult, and there will be many compatibility and security problems, because firewalls and proxy servers usually block these types of traffic. The best way to communicate between applications is through the HTTP protocol, because HTTP supports all Internet browsers and servers. Therefore, SOAP protocol came into being.

SOAP (Simple Object Access Protocol) is a simple protocol for exchanging information in a decentralized or distributed environment. It is an XML-based protocol. It includes four parts: SOAP envelope, which defines a framework to describe what the content in the message is, who sent it, who should accept and handle it and how to handle it; SOAP encoding rules, used to represent instances of data types that applications need to use; Soarpc representation, which represents the contract of remote procedure call and reply; SOAP binding, using the underlying protocol to exchange information.

Although these four parts are all defined as a part of the whole SOAP, they are functionally overlapping and independent of each other. In particular, envelopes and encoding rules are defined in different XML namespaces, which makes the definition easier.

What is CXF?

Apache CXF = Celtix+XFire, the predecessor of Apache CXF is Apache CeltiXfire, and now it has been officially renamed Apache CXF, hereinafter referred to as CXF. CXF inherits the essence of Celtix and XFire, provides comprehensive support for JAX-WS, and provides support for various bindings, data binding, transmission and formats. According to the needs of actual projects, it can easily realize the publication and use of Web services by adopting code priority or WSDL priority. At present, it is only an incubation project of Apache.

Apache CXF is an open source service framework. CXF helps you build and develop services such as JAX-WS using front-end programming API. These services can support multiple protocols, such as SOAP, XML/HTTP, RESTful HTTP or CORBA, and can run on multiple transport protocols, such as HTTP, JMS or JBI. CXF greatly simplifies the creation of services, inherits the tradition of XFire, and can naturally integrate seamlessly with Spring.

CXF contains a large number of functional features, but mainly focuses on the following aspects:

Support for Web service standards: CXF supports various Web service standards, including SOAP, Basic Summary, WS-Addressing, WS-Policy, WS-ReliableMessaging and WS-Security.

Front-end: CXF supports various "front-end" programming models. CXF implements JAX-WS API (following JAX-WS version 2.0 TCK), and it also includes a "simple front-end" that allows clients and endpoints to be created without annotations. CXF supports Java's WSDL first development and code first development modes.

Easy to use: CXF design is more intuitive and easy to use. There are a lot of simple APIs that can quickly build code-first services, and various Maven plug-ins also make integration easier, support JAX-WS API, support more simplified XML configuration in Spring 2.0, and so on.

Support binary and legacy protocols: CXF is a pluggable architecture that can support XML and non-XML type bindings, such as JSON and CORBA.

Let's create a simple webservice using cxf.

First of all, the packages that cxf needs: The website shows that the following packages are all necessary, but the red package is not used in my actual project.

Everyone can add adaptation packages according to their own needs.

cxf.jar

commons-log . jar

Geronimo-activation.jar (or Sun equivalent)//

Geronimo-annotation.jar (or Sun equivalent)//

Geronimo-javamail.jar (or Sun equivalent)//

Niti jar

jaxb-api.jar

jaxb-impl.jar

stax-api.jar//

XmlSchema.jar

wstx-asl.jar

xml-resolver.jar

Distributed applications and browsers

Studying the current application development, you will find an absolute trend: people begin to prefer browser-based thin client applications. This is of course not because thin customers can provide a better user interface, but because it can avoid the high cost of publishing desktop applications. The cost of publishing desktop applications is high, partly because of the problems of application installation and configuration, and partly because of the communication problems between clients and servers.

Traditional Windows rich client applications use DCOM to communicate with the server and call remote objects. Configuring DCOM to work normally in a large network will be a challenging task and a nightmare for many IT engineers. In fact, many IT engineers would rather put up with the functional limitations brought by browsers than run DCOM on LAN. In my opinion, the result is that an application is easy to publish, but difficult to develop, and the user interface is extremely limited. In extreme cases, you spend more money and time and develop an application that is weaker from the user's point of view. Don't believe it? Ask your accountant what he thinks of the new browser-based accounting software: Most business program users want to use a more friendly Windows user interface.

Regarding the communication between the client and the server, a perfect solution is to use the HTTP protocol for communication. This is because any machine running a web browser uses the HTTP protocol. At the same time, many firewalls are currently configured to allow only HTTP connections.

Many commercial programs also face another problem, namely interoperability with other programs. If all the applications are in COM or. NET language and run on Windows platform, the world will be peaceful. However, in fact, most business data are still stored in mainframe as non-relational files (VSAM) and accessed by mainframe programs written in COBOL language. Moreover, many commercial programs continue to be written in C++, Java, Visual Basic and other languages. Now, except the simplest program, all applications need to be integrated with applications running on other heterogeneous platforms and exchange data. This kind of task is usually accomplished by special methods, such as file transfer and analysis, message queuing, and API only suitable for certain situations, such as IBM's Advanced Program-to-Program Communication (APPC). There is no communication standard before, which is independent of platform, construction model and programming language. Only through Web Service can the client and server communicate freely with HTTP, regardless of the platforms and programming languages of the two programs.

What is a network service?

Web service is a new platform for building interoperable distributed applications. As a Windows programmer, you may have built a component-based distributed application with COM or DCOM. COM is a very good component technology, but it is easy to cite the situation that COM can't meet the requirements.

Web service platform is a set of standards that define how applications can achieve interoperability on the Web. You can write Web services in any language you like and on any platform you like, as long as we can query and access these services through web service standards.

Web service platform needs a set of protocols to realize the creation of distributed applications. Any platform has its data representation method and type system. In order to achieve interoperability, Web service platforms must provide a set of standard types of systems to communicate with different platforms, programming languages and component models. In the traditional distributed system, the interface-based platform provides some methods to describe interfaces, methods and parameters. Similarly, the Web service platform must provide a standard to describe the Web service, so that customers can get enough information to call this Web service. Finally, we must also have a way to call this Web service remotely. This method is actually a remote procedure call protocol (RPC). In order to achieve interoperability, this RPC protocol must also be independent of platform and programming language.

Web service is a new branch of web application. They are self-contained, self-describing and modular applications, which can be published, located and called through the web. Web services can perform any function from simple requests to complex business processing. After deployment, other Web service applications can discover and invoke the services it deploys.

Web service is an application, which can use standard Internet protocols, such as Hypertext Transfer Protocol (HTTP) and XML, to display its functions programmatically on the Internet and intranet. You can think of Web services as component programming on the Web.

1 history

Technologies widely used in the network:

◆TCP/IP: A universal network protocol, which is used by various devices.

◆HTML: Universal user interface, which can display data with HTML tags.

◆Java: Write a universal programming language that can be run anywhere once.

◆XML: a universal data expression language and a simple method to transmit structured data on the web.

Their characteristics are openness and cross-platform, and openness is the foundation of Web services.

2 network development trend

The content is more dynamic

◆ Bandwidth is cheaper and easier to obtain.

◆ Memory storage is cheaper and easier to obtain.

Ubiquitous computing has become more important: a large number of devices such as mobile phones, pages, computers and PCs have become ubiquitous on the Internet, platforms have become more diversified, and cross-platform technologies such as XML have become more important.

What role does web service play?

These trends mean that it is very important to process, manipulate and summarize content more intelligently. Let's look at four trends predicted from the perspective of Web services:

◆ Content is more dynamic: web services must be able to combine content from many different sources, including stocks, weather, news, etc. In the traditional environment, inventory levels, shopping orders or catalog information all come from the back-end system.

Bandwidth is cheaper: network services can distribute various types of content (audio, video streams, etc. ).

Cheaper storage: web services must be able to intelligently handle large amounts of data, which means using technologies such as databases, LDAP directories, buffering and load balancing software to maintain scalability.

◆ Pervasive computing is more important: web services cannot require customers to use a certain version of the traditional windows browser, but must support various devices, platforms, browser types and various content types.

4 Two important technologies

To achieve this goal, Web services should use two technologies:

◆XML XML is a good way to transmit structured data on the web. Web services should manipulate data in a reliable and automatic way, and HTML will not meet the requirements. However, XML can make Web services process data very conveniently, and the separation of its content and representation is ideal.

◆SOAP SOAP uses XML messages to call remote methods, so that web services can interact with remote machines through the post and get methods of HTTP protocol, and SOAP is more robust, flexible and easy to use.

Other technologies, such as UDDI and WSDL, are closely combined with XML and SOAP for service discovery. & lt/SPAN>。

These three technologies constitute the Web service platform.

XML and XSD

Extensible Markup Language (XML) is the basic format for representing data in Web service platform. Besides being easy to build and analyze, the main advantage of XML is that it is independent of platforms and vendors. Indifference is more important than technological advantages: software vendors will not choose technologies invented by competitors.

XML solves the problem of data representation, but it does not define a set of standard data types, let alone how to extend this set of data types. For example, what exactly does an integer stand for? 16,32 or 64? These details are very important to achieve interoperability. XML Schema(XSD) developed by W3C is a set of standards to solve this problem. It defines a set of standard data types and gives a language to extend this set of data types. The Web service platform uses XSD as its data type system. When you build a Web service in a certain language (such as VB.NET or C#), all data types you use must be converted to XSD types in order to meet the Web service standards. The tool you use may have automatically completed this conversion for you, but you may modify the conversion process according to your own needs.

WSDL

When each function is called, how do you tell others about the functions and parameters of your Web service? You can write a set of documents yourself, and even tell people who need to use your Web service orally. These informal methods have at least one serious problem: when programmers sit in front of computers and want to use your Web services, their tools (such as Visual Studio) can't help them because they don't know your Web services at all. The solution is to provide a formal description document in a machine-readable way. Web service description language (WSDL) is such an XML-based language, which is used to describe Web services and their functions, parameters and return values. Because it is based on XML, WSDL is readable by both machines and people, which will be a great benefit. Some of the latest development tools can not only generate WSDL documents according to your Web services, but also import WSDL documents to generate codes for calling corresponding Web services.