(Reprint) a thorough understanding of: WebService in the end is what?

(Reprint) a thorough understanding of: WebService in the end is what?

 

Someone recently mentioned web service interface to always tell me, how, how drops, I feel very ears pierced, web service is a service package up the server technology, providing the performance of the external interface, so, not a web service interfaces !!!!!!

 

Reprinted Address: http://blog.csdn.net/qq_19916577/article/details/44988015

 

I. Preamble

  We more or less have heard WebService (Web services), there is a period of time a lot of computer journals, books and Web sites are mentioned and wantonly publicity WebService technology, many of them boast a lot of advertising and ingredients. But have to admit that WebService is really a new and promising technology, then what in the end is WebService? When should you use?

   The current phase of application development presents two very different tendencies: one is based on thin-client application browser, one is based on a rich client application browser (RIA), of course, the latter technique Some relatively more trendy (as is now very popular Html5 technology), here mainly about the former.

   Based thin client application browser is not due to the thin client can provide a better user interface, but because it can avoid the high cost spent on desktop applications published. Desktop publishing applications costly, partly because of problems in the application installation and configuration, and the other half is due to problems in communication between the client and the server. Traditional Windows rich client application uses DCOM to communicate with the server and the remote object invocation. DCOM configured so that in a large network in normal operation will be a challenging task, but also many IT engineers nightmare. In fact, many IT engineers would rather tolerate functional limitations brought about by the browser, do not want to run it in a local area network DCOM. Communication problems on the client and server, a perfect solution is to use the HTTP protocol to communicate. This is because any machine running the Web browser are using the HTTP protocol. At the same time, many current firewalls are also configured to allow only HTTP connections. Many commercial programs also face another problem, that is interoperable with other programs. If all the applications are written using COM or .NET language and run on the Windows platform, it is peace and harmony. However, the fact that most business data is still stored in the form of non-relational file (VSAM) on the mainframe by the program written in COBOL mainframe access. Moreover, there are still many commercial programs continue to use C ++, Java, Visual Basic, and a variety of other languages. Now, in addition to the most simple procedure, all applications need to integrate with other applications running on heterogeneous platforms and data exchange. Such tasks usually by a special method, such as file transfer and analysis, message queue, and only for some cases of the API, such as IBM's Advanced Program to Program alternating current (APPC) to complete the like. In the past, there is no application communication standard, is platform independent, component models and programming languages. Only the client and server to be able to freely communicate with HTTP through Web Service, regardless of what the two procedures platforms and programming languages ​​Yes.

 

Two, WebService in the end what is?

   In a nutshell: WebService technology is a programming language and a remote call across operating system platforms across.

   The so-called cross-platform and cross-language programming, server program that is written using java, client program you can use other programming language, and vice versa! Cross-operating system platform refers to the server program and the client program can run on different operating systems.

    The so-called long-distance calls, that is, a program on a computer a can call to an object method on another computer B, for example, CUP supplied to the mall pos credit card systems, the code transfer method mall POS machine transfers the call in fact, the bank is run on the server. As another example, amazon, weather forecasting system, Taobao, the school network, Baidu and other services to their system exposed as webservice out of service, so that third-party Web sites and programs can call these services, which expands the market occupies its own system rate, to blow the big concept, the so-called SOA applications.

   In fact, can be understood from various angles WebService, the surface, WebService is an application that exposes a Web through an API call to the outside world, that is to say the method can be programmed to call this application over the Web. We call this WebService application called the client, and to provide this WebService application called the service side. Look deeper, WebService is to build distributed applications interoperable new platform is a platform, is a set of standards. It defines how an application interoperability on the Web, you can use any language you like, you like to write on any platform Web service, as long as we can query and access to these services through Web service standards.

   WebService platform needs to create a set of protocols to implement distributed applications. Any platform has its data representation and type system. To achieve interoperability, WebService platform must provide a set of standard type system used to communicate different platforms, programming languages ​​and component models of different types of systems. Web service platform must provide a standard to describe the Web service, so that customers can get enough information to call the Web service. Finally, we must also have a way to remotely invoke this Web service, this method is actually a remote procedure call protocol (RPC). In order to achieve interoperability, the RPC protocol must also be independent of platforms and programming languages.

 

Three, WebService platform technology

  XML + XSD, SOAP and WSDL is composed of three WebService technology platform.

XML+XSD:

  WebService HTTP protocol to transmit data, the data package in XML format (i.e., the XML description method which calls the remote service object, what parameters are passed, and returns a result of what service objects). XML WebService platform is represented in the data format. In addition to easy to set up and easy to analyze, the main advantage of XML is that it is both platform-independent, is vendor-independent. Independence is more important than the technical superiority: software vendors will not choose a technology invented by a competitor's.

  XML solves the problem of data representation, but it does not define a standard set of data types, but does not say how to extend this set of data types. For example, the number of plastic surgery in the end mean anything? 16, 32, 64? These details are important for achieving interoperability. XML Schema (XSD) is a set of standards specifically address this issue. It defines a set of standard data types, and gives a language to extend the set of data types. WebService internet is used as the data type XSD system. When you construct a Web service using a language (such as VB.NET or C #), in order to comply WebService standard, all data types you use must be converted to XSD types. The tools you use may have been automatically help you complete the conversion, but you are likely to modify the conversion process according to your needs.

SOAP:

   When WebService send requests and receive results using the HTTP protocol, the request content and the results of the content transmission are in XML format package, and adds some specific HTTP message header, to indicate the content of the format of the HTTP message, these specific HTTP header and XML content format is SOAP protocol. SOAP provides a standard RPC method to call Web Service.

  = HTTP protocol SOAP protocol + XML data format

  SOAP protocol defines the format of the SOAP message, SOAP is a protocol based on HTTP protocol, SOAP is based on XML and XSD, XML is SOAP encoding of data. Analogy: HTTP is an ordinary road, XML is the green buffer zone on both sides and in the middle of the fence, SOAP is an ordinary road through the buffer zone and add fence transformation of the expressway.

WSDL:

   For example, we go to the store to buy things, we must first know the store to buy something, then come back to buy, business practice is to put up advertising posters. WebService, too, WebService WebService client wants to invoke a service, first of all we have to know the address of where the service, and the service in what can be called, so, we must first end WebService works to illustrate his home by a WSDL file So what services can begin to call, what is the service (which methods the service there, what method accepts parameters are, what is the return value), which represents the service network address url addresses, by what means to call the service.

   WSDL (Web Services Description Language) is such an XML-based language for describing Web Service and its functions, parameters and return values. It is a standard format WebService client and server can understand. Because it is based on XML, WSDL is both machine-readable, but also human-readable, it will be a great advantage. Some of the latest development tools, both based on your Web service WSDL document generation, but also to import the WSDL document, generating WebService proxy class call the appropriate code.

  WSDL files stored on the Web server, you can access it via a url address. Before a client to call a WebService service, the WSDL file to know the address of the service. WebService service providers can be exposed in two ways its WSDL file address: 1 registered to UDDI server to be searched person; 2 directly to the client to tell the caller...

 

Four, WebService development

  WebService development can be divided into server-side development and client development two aspects:

   Service-side development: the publishing business methods into the company's internal systems WebService services for remote collaboration unit and individual calls. (With some of the WebService framework can easily publish their own business objects into WebService service, typical WebService framework for Java area include:. Axis, xfire, cxf etc., java ee server usually supports publishing WebService services such as JBoss)
   client development: calling someone posted WebService service, the majority of people engaged in the development belong to this aspect, for example, weather forecasts calling WebService service. (Using the manufacturer's WSDL2Java like tool to generate a proxy class code static calls; client programming API class factory supplied; using an earlier standard SUN company jax-rpc development kit; use SUN's latest standards jax-ws Development Kit Of course SUN has been acquired by ORACLE)

   Works WebService call: the client, we passed to the various types of this WebService client API url address wsdl file, the API will create the underlying proxy class, I call these agents can access the webservice service . The proxy class method calls from client request into a data format and then sent to the soap through the HTTP protocol, and stores the received data into a return value returned soap. On the service side, the nature of various types of WebService framework is a big Servlet, when a remote client to call it a request sent from the data format of the soap through the http protocol, which analyzes the data, we know what to call java class which method, then went to find or create the object, and call its methods, then packaging method returns the results to the data format of the soap message back to the client via http response.

 

V. Applications

1, cross-firewall communication:

   If the application has thousands of users, and distributed around the world, then the communication between the client and the server will be a thorny issue. Because there is usually a firewall or proxy server between the client and the server. In this case, the use of DCOM is not so simple, usually not easy to publish a client program to such a large number of the hands of every user. The traditional approach is to select the browser as a client, wrote a lot ASP page, the middle-tier application is exposed to end users. The result of this development is difficult, it is difficult to maintain the program. If the intermediate layer components into WebService, then you can call the intermediate layer components directly from the user interface. From most people's experience, in a user interface and the intermediate layer has a more interactive applications, the use WebService this structure, can save 20% of the development time spent on user interface programming.

2, application integration:

   Enterprise application developers know, the enterprise often have to be written in different languages, a variety of programs that run on different platforms integrate, and this integration will spend a lot of development efforts. Applications often require data from a program running on the IBM mainframe; or send data to the host or application to UNIX. Even on the same platform, different software manufacturers often need to integrate various software together. By WebService, it can be easily integrated application of different structures.

3, B2B integration:

   WebService integrated with the application, it can make business processes more automated within the company. But when trading across suppliers and customers push the boundaries of what happens when companies? Integrated cross-company business transactions often called B2B integration. WebService B2B integration is the key to success. By WebService, companies can put critical business applications "exposed" to the designated suppliers and customers. For example, the electronic order systems and electronic invoice system "exposed" out, customers can send orders electronically, suppliers of raw materials purchase invoices can be sent electronically. Of course, this is not a new concept, EDI (Electronic Document Interchange) has long been the case. However, WebService implementation is much simpler than EDI, and WebService running on the Internet, can be easily achieved anywhere in the world, whose operating costs are relatively low. However, WebService is not as EDI as a complete solution for document exchange or B2B integration. WebService only B2B integration is a key part, but also many other parts to achieve integration.

   WebService to achieve maximum benefit with B2B integration is that it can easily achieve interoperability. As long as the business logic "exposed" out, become WebService, you can make calls to any designated partners such business logic, regardless of their system runs on any platform, using any programming language. This greatly reduces the time and cost spent on integrated B2B, EDI can not afford to make many of the original SMEs can achieve B2B integration.

4, software, and data reuse:   

      Software reuse is a big topic, a lot of reusable forms, the degree of reuse of different sizes. The most basic form is a source code module or class reuse, is a form of binary form component reuse. WebService application can use standard methods to functions and data "exposed" out, for other applications, to achieve the service-level reuse.

 

Six, not to use

1, stand-alone applications:

      Currently, businesses and individuals also use a lot of desktop applications. Some only need to communicate with other programs on the machine. In this case, it is best not to use WebService, as long as the local API on it. COM is well suited for work in this case, because it small and fast. Run the server software on the same server as well. Preferably directly or with other local COM API to call between applications. Of course WebService can also be used on these occasions, but did not consume too much, and will not bring any good.

2, LAN homogeneous application:

      In many applications, all programs are developed with VB or VC, use COM on Windows platform, running on the same local area network. For example, there are two server applications require communication with each other or have a Win32 or the WinForm client program to connect to another server on the LAN. In these procedures, the use of DCOM will be much more effective than SOAP / HTTP. Similarly, if a program to connect to another .NET .NET program on the LAN should be used .NETremoting. Interestingly, in .NETremoting, you can also specify the use of SOAP / HTTP to WebService call. But better to direct RPC call via TCP, will be much more effective.

Someone recently mentioned web service interface to always tell me, how, how drops, I feel very ears pierced, web service is a service package up the server technology, providing the performance of the external interface, so, not a web service interfaces !!!!!!

 

Reprinted Address: http://blog.csdn.net/qq_19916577/article/details/44988015

 

I. Preamble

  We more or less have heard WebService (Web services), there is a period of time a lot of computer journals, books and Web sites are mentioned and wantonly publicity WebService technology, many of them boast a lot of advertising and ingredients. But have to admit that WebService is really a new and promising technology, then what in the end is WebService? When should you use?

   The current phase of application development presents two very different tendencies: one is based on thin-client application browser, one is based on a rich client application browser (RIA), of course, the latter technique Some relatively more trendy (as is now very popular Html5 technology), here mainly about the former.

   Based thin client application browser is not due to the thin client can provide a better user interface, but because it can avoid the high cost spent on desktop applications published. Desktop publishing applications costly, partly because of problems in the application installation and configuration, and the other half is due to problems in communication between the client and the server. Traditional Windows rich client application uses DCOM to communicate with the server and the remote object invocation. DCOM configured so that in a large network in normal operation will be a challenging task, but also many IT engineers nightmare. In fact, many IT engineers would rather tolerate functional limitations brought about by the browser, do not want to run it in a local area network DCOM. Communication problems on the client and server, a perfect solution is to use the HTTP protocol to communicate. This is because any machine running the Web browser are using the HTTP protocol. At the same time, many current firewalls are also configured to allow only HTTP connections. Many commercial programs also face another problem, that is interoperable with other programs. If all the applications are written using COM or .NET language and run on the Windows platform, it is peace and harmony. However, the fact that most business data is still stored in the form of non-relational file (VSAM) on the mainframe by the program written in COBOL mainframe access. Moreover, there are still many commercial programs continue to use C ++, Java, Visual Basic, and a variety of other languages. Now, in addition to the most simple procedure, all applications need to integrate with other applications running on heterogeneous platforms and data exchange. Such tasks usually by a special method, such as file transfer and analysis, message queue, and only for some cases of the API, such as IBM's Advanced Program to Program alternating current (APPC) to complete the like. In the past, there is no application communication standard, is platform independent, component models and programming languages. Only the client and server to be able to freely communicate with HTTP through Web Service, regardless of what the two procedures platforms and programming languages ​​Yes.

 

Two, WebService in the end what is?

   In a nutshell: WebService technology is a programming language and a remote call across operating system platforms across.

   The so-called cross-platform and cross-language programming, server program that is written using java, client program you can use other programming language, and vice versa! Cross-operating system platform refers to the server program and the client program can run on different operating systems.

    The so-called long-distance calls, that is, a program on a computer a can call to an object method on another computer B, for example, CUP supplied to the mall pos credit card systems, the code transfer method mall POS machine transfers the call in fact, the bank is run on the server. As another example, amazon, weather forecasting system, Taobao, the school network, Baidu and other services to their system exposed as webservice out of service, so that third-party Web sites and programs can call these services, which expands the market occupies its own system rate, to blow the big concept, the so-called SOA applications.

   In fact, can be understood from various angles WebService, the surface, WebService is an application that exposes a Web through an API call to the outside world, that is to say the method can be programmed to call this application over the Web. We call this WebService application called the client, and to provide this WebService application called the service side. Look deeper, WebService is to build distributed applications interoperable new platform is a platform, is a set of standards. It defines how an application interoperability on the Web, you can use any language you like, you like to write on any platform Web service, as long as we can query and access to these services through Web service standards.

   WebService platform needs to create a set of protocols to implement distributed applications. Any platform has its data representation and type system. To achieve interoperability, WebService platform must provide a set of standard type system used to communicate different platforms, programming languages ​​and component models of different types of systems. Web service platform must provide a standard to describe the Web service, so that customers can get enough information to call the Web service. Finally, we must also have a way to remotely invoke this Web service, this method is actually a remote procedure call protocol (RPC). In order to achieve interoperability, the RPC protocol must also be independent of platforms and programming languages.

 

Three, WebService platform technology

  XML + XSD, SOAP and WSDL is composed of three WebService technology platform.

XML+XSD:

  WebService HTTP protocol to transmit data, the data package in XML format (i.e., the XML description method which calls the remote service object, what parameters are passed, and returns a result of what service objects). XML WebService platform is represented in the data format. In addition to easy to set up and easy to analyze, the main advantage of XML is that it is both platform-independent, is vendor-independent. Independence is more important than the technical superiority: software vendors will not choose a technology invented by a competitor's.

  XML solves the problem of data representation, but it does not define a standard set of data types, but does not say how to extend this set of data types. For example, the number of plastic surgery in the end mean anything? 16, 32, 64? These details are important for achieving interoperability. XML Schema (XSD) is a set of standards specifically address this issue. It defines a set of standard data types, and gives a language to extend the set of data types. WebService internet is used as the data type XSD system. When you construct a Web service using a language (such as VB.NET or C #), in order to comply WebService standard, all data types you use must be converted to XSD types. The tools you use may have been automatically help you complete the conversion, but you are likely to modify the conversion process according to your needs.

SOAP:

   When WebService send requests and receive results using the HTTP protocol, the request content and the results of the content transmission are in XML format package, and adds some specific HTTP message header, to indicate the content of the format of the HTTP message, these specific HTTP header and XML content format is SOAP protocol. SOAP provides a standard RPC method to call Web Service.

  = HTTP protocol SOAP protocol + XML data format

  SOAP protocol defines the format of the SOAP message, SOAP is a protocol based on HTTP protocol, SOAP is based on XML and XSD, XML is SOAP encoding of data. Analogy: HTTP is an ordinary road, XML is the green buffer zone on both sides and in the middle of the fence, SOAP is an ordinary road through the buffer zone and add fence transformation of the expressway.

WSDL:

   For example, we go to the store to buy things, we must first know the store to buy something, then come back to buy, business practice is to put up advertising posters. WebService, too, WebService WebService client wants to invoke a service, first of all we have to know the address of where the service, and the service in what can be called, so, we must first end WebService works to illustrate his home by a WSDL file So what services can begin to call, what is the service (which methods the service there, what method accepts parameters are, what is the return value), which represents the service network address url addresses, by what means to call the service.

   WSDL (Web Services Description Language) is such an XML-based language for describing Web Service and its functions, parameters and return values. It is a standard format WebService client and server can understand. Because it is based on XML, WSDL is both machine-readable, but also human-readable, it will be a great advantage. Some of the latest development tools, both based on your Web service WSDL document generation, but also to import the WSDL document, generating WebService proxy class call the appropriate code.

  WSDL files stored on the Web server, you can access it via a url address. Before a client to call a WebService service, the WSDL file to know the address of the service. WebService service providers can be exposed in two ways its WSDL file address: 1 registered to UDDI server to be searched person; 2 directly to the client to tell the caller...

 

Four, WebService development

  WebService development can be divided into server-side development and client development two aspects:

   Service-side development: the publishing business methods into the company's internal systems WebService services for remote collaboration unit and individual calls. (With some of the WebService framework can easily publish their own business objects into WebService service, typical WebService framework for Java area include:. Axis, xfire, cxf etc., java ee server usually supports publishing WebService services such as JBoss)
   client development: calling someone posted WebService service, the majority of people engaged in the development belong to this aspect, for example, weather forecasts calling WebService service. (Using the manufacturer's WSDL2Java like tool to generate a proxy class code static calls; client programming API class factory supplied; using an earlier standard SUN company jax-rpc development kit; use SUN's latest standards jax-ws Development Kit Of course SUN has been acquired by ORACLE)

   Works WebService call: the client, we passed to the various types of this WebService client API url address wsdl file, the API will create the underlying proxy class, I call these agents can access the webservice service . The proxy class method calls from client request into a data format and then sent to the soap through the HTTP protocol, and stores the received data into a return value returned soap. On the service side, the nature of various types of WebService framework is a big Servlet, when a remote client to call it a request sent from the data format of the soap through the http protocol, which analyzes the data, we know what to call java class which method, then went to find or create the object, and call its methods, then packaging method returns the results to the data format of the soap message back to the client via http response.

 

V. Applications

1, cross-firewall communication:

   If the application has thousands of users, and distributed around the world, then the communication between the client and the server will be a thorny issue. Because there is usually a firewall or proxy server between the client and the server. In this case, the use of DCOM is not so simple, usually not easy to publish a client program to such a large number of the hands of every user. The traditional approach is to select the browser as a client, wrote a lot ASP page, the middle-tier application is exposed to end users. The result of this development is difficult, it is difficult to maintain the program. If the intermediate layer components into WebService, then you can call the intermediate layer components directly from the user interface. From most people's experience, in a user interface and the intermediate layer has a more interactive applications, the use WebService this structure, can save 20% of the development time spent on user interface programming.

2, application integration:

   Enterprise application developers know, the enterprise often have to be written in different languages, a variety of programs that run on different platforms integrate, and this integration will spend a lot of development efforts. Applications often require data from a program running on the IBM mainframe; or send data to the host or application to UNIX. Even on the same platform, different software manufacturers often need to integrate various software together. By WebService, it can be easily integrated application of different structures.

3, B2B integration:

   WebService integrated with the application, it can make business processes more automated within the company. But when trading across suppliers and customers push the boundaries of what happens when companies? Integrated cross-company business transactions often called B2B integration. WebService B2B integration is the key to success. By WebService, companies can put critical business applications "exposed" to the designated suppliers and customers. For example, the electronic order systems and electronic invoice system "exposed" out, customers can send orders electronically, suppliers of raw materials purchase invoices can be sent electronically. Of course, this is not a new concept, EDI (Electronic Document Interchange) has long been the case. However, WebService implementation is much simpler than EDI, and WebService running on the Internet, can be easily achieved anywhere in the world, whose operating costs are relatively low. However, WebService is not as EDI as a complete solution for document exchange or B2B integration. WebService only B2B integration is a key part, but also many other parts to achieve integration.

   WebService to achieve maximum benefit with B2B integration is that it can easily achieve interoperability. As long as the business logic "exposed" out, become WebService, you can make calls to any designated partners such business logic, regardless of their system runs on any platform, using any programming language. This greatly reduces the time and cost spent on integrated B2B, EDI can not afford to make many of the original SMEs can achieve B2B integration.

4, software, and data reuse:   

      Software reuse is a big topic, a lot of reusable forms, the degree of reuse of different sizes. The most basic form is a source code module or class reuse, is a form of binary form component reuse. WebService application can use standard methods to functions and data "exposed" out, for other applications, to achieve the service-level reuse.

 

Six, not to use

1, stand-alone applications:

      Currently, businesses and individuals also use a lot of desktop applications. Some only need to communicate with other programs on the machine. In this case, it is best not to use WebService, as long as the local API on it. COM is well suited for work in this case, because it small and fast. Run the server software on the same server as well. Preferably directly or with other local COM API to call between applications. Of course WebService can also be used on these occasions, but did not consume too much, and will not bring any good.

2, LAN homogeneous application:

      In many applications, all programs are developed with VB or VC, use COM on Windows platform, running on the same local area network. For example, there are two server applications require communication with each other or have a Win32 or the WinForm client program to connect to another server on the LAN. In these procedures, the use of DCOM will be much more effective than SOAP / HTTP. Similarly, if a program to connect to another .NET .NET program on the LAN should be used .NETremoting. Interestingly, in .NETremoting, you can also specify the use of SOAP / HTTP to WebService call. But better to direct RPC call via TCP, will be much more effective.

Guess you like

Origin www.cnblogs.com/niewd/p/11345552.html