What is WebServices?
It is a universal model of building applications that can be run in any operating system that supports network communication; it is a new branch of Web application that is a self-contained, self-describing, modular application that can be published, positioned, and called through the web. A Web service is an application component that logically provides data and services to other applications. Each application accesses a Web service through a network protocol and some standard data formats (HTTP,XML,SOAP), through the web Service internal execution gets the desired results. WEB Service can perform any function from simple requests to complex business processing. Once deployed, other Web service applications can discover and invoke the services it deploys.
key technologies and rules
The following key techniques and rules are used when building and using Web service:
1.XML: Standard method for describing data.
2.SOAP: The protocol that represents the exchange of information.
3.wsdl:web Service Description Language.
4.UDDI: General description, Discovery and integration, which is a platform-independent, XML-based protocol for describing commerce on the Internet.
XML
Extensible Markup Language (XML) is the basic format for representing data in a Web service platform. In addition to being easy to establish and easy to analyze, the main advantage of XML is that it is platform-independent and vendor-independent. Independence is more important than technical superiority: Software vendors do not choose a technology invented by competitors.
Soap
SOAP is the standard communication protocol for Web service, and SOAP is the abbreviation for simple Object access Protocoll. It is a standardized XML message format for transmitting messages.
Wsdl
The full name of the WSDL is the Web service Description Language, which is a descriptive language for Web services based on XML format. The main purpose of the Web service provider is to provide all relevant content of their Web services, such as the transmission of the services provided, service method interfaces, interface parameters, service paths, etc., to generate the corresponding full document, published to the user. The user can create the corresponding SOAP request message via HTTP to the WebService provider through this WSDL document, and the Web service passes the SOAP return message back to the requestor after the service request is completed. The service requester then parses the SOAP return message from the WSDL document into what it can understand.
UDDI
To publish a Web service for UDDI registration, UDDI is a specification for creating a registry service so that everyone can register their Web service for publication for the user to find. However, when a service provider wants to publish its Web service to the world, In order to find its services externally, the service provider can register its own web service with the appropriate UDDI business registration site, which currently has 4 UDDI business registration sites worldwide, such as IBM. Because the address URI of the Web service is already given in the WSDL file, the external can make the corresponding Web service call directly from the URI provided by the WSDL. So UDDI is not a required Web service component, and the service party can completely register without UDDI.
Create and publish your own WS
1 Installing MyEclipse
2 Configuring Tomcat
Open MyEclipse
Menu bar –> file–> new–> Web Service Project
Here, we use the JAX-ws approach.
Jax-ws
JAX-WS is only in Java1.6, the new WebService mode, based on the annotation configuration webservice, very similar to the WebService in ASP, the difficulty has been much lower than the Xfire mode configuration.
REST (Jax-rs)
Less to use
Xfire (OBSOLETE)
More cumbersome configuration
Create a package and class library in service to implement your own business.
We create a user management system that naturally needs to be managed by users.
Publish WS
Until this WS-Release is complete, the next configuration tomcat
In the pop-up form, expand MyEclipse->servers–>tomcat
Right-click the project to add a library file
Here, all the steps begin to deploy with the configuration complete
Start Tomcat
Locate the deployment icon in the toolbar
Deployment complete, open IE for testing
creating a Client for testing
At this point, the class library file required by WS will be generated in the project
Create a Call test class
Publish your own webservice on the MyEclipse