This article link: http://blog.csdn.net/kongxx/article/details/7738717
Apache CXF One of the actual combat Hello World Web Service
Apache CXF Combat II Integrated sping and Web container
Apache CXF Three-combat Transfer Java objects
Apache CXF Real-combat four build restful Web
Web Service ComponentsThe basic Web service platform is XML + HTTP. All standard Web service uses the following components:
SOAP (Simple Object Access Protocol)
UDDI (general description, Discovery, and integration)
{Public String getname (string name){Return "hello" + name;}}
2. Write a WSDD File
The content of the deploy. WSDD file is as follows:
3. Publish a service:
Edit deploy. bat, and axis_lib is the axis. Jar path. The content is as follows:
Set axis_lib = D :\workspace \ test \ WEB-INF \ LibSet java_cmd = Java-djava. Ext. dirs = % axis_lib %Set axis_serv
-all generates all start endpoint codes: Types,service Proxy,,service interface, server mainline, client mainline, implementation object, and an T build.xml file.
See Detailed usage: http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html
The first use of this set of CXF tools, found not very convenient, after all, rely on CXF provided by the tool jar package, the individual is not very like to use.
Later fou
Definition of WEB Service
It is defined by the consortium as a software system designed to support interoperability between machines across the network. Web service services are often defined as a set of modular APIs that can be invoked over the network to perform a remote system's request
What is the most popular technology now? Is it Java, is. Net, or what? I think it should be the Web service technology.
Web Service provides a simple, flexible programming model, and uses the current standard on the Internet to avoid the problems and disputes that developer
Recently began to understand WCF, wrote the simplest HelloWorld, want to implement communication through the Java client. Did not expect to my foundation, incredibly spent a full two days (of course, outside the work of time, hehe), the whole process of great expense, close-up this article, for the needs of friends reference:First step: Build a WCF ServiceCreate a new WCF solution, add three items, Hellotimeservice (class library), Hellotimehost (cons
(i) WEB Service server development1. Create a new Web service project, menu new, Web Service project,2. Create a new Java Bean, which is a normal class, new-Class, Public string Sayhaha
protocols such as SOAP, Xml/http, RESTful HTTP, or CORBA and work over a variety of Transports such as HTTP, JMS or JBI.
?? After the download is done, unzip and find the Lib directory, add the jar file to your Java project, and you can start writing your Web service. Words don't say much, directly on the code. PackageCom.lovo.domain;ImportJavax.xml.bind.an
Static pages: pages written in static programming language are static pages, support static pages of the language, CSS HTML XML, do not manually change the source code, the page will not change.Dynamic pages: Pages written in dynamic programming languages are dynamic pages, the languages that support dynamic pages are, Java PHP. NET, which displays different pages depending on the time users visit and the different users.Nginx website
();} Catch (ioexception e ){}}
Public void deletefile (){File F = new file ("C:/writedata.txt ");// Check whether the object exists. If yes, delete the object directly.If (F. exists ()){F. Delete ();}}
}
After the class is written, you need to add a listener in Web. XML to enable the servlet class to be automatically executed and add the following content to Web. xml:
Code highlighting produced by Actipro
are said to be rest design, which is actually a rpc-rest, not a rest idea.2. Abstract operations-based CRUDThis is very simple, HTTP get,put,post,delete corresponding to the Read,update,create,delete four operations, if only as a resource for the operation, the abstraction of these four are enough, But for some of today's complex business service interface designs, this abstraction may not be sufficient. In fact, this is also in the back of several
Web services are essentially HTTP requests, except for Web service-specific specifications, such as the XML file format in which the server communicates with both clients to complete a description of a Web service invocation. Of course, this XML also has a specific format, a
Web Services and write stub client to access web services
1. Compile the server program server, sayhello. Java, and compile server. sayhello. java.
Package server;Public class sayhello{Public String getname (string name){Return "hello" + name;}}
2. Write a WSDD File
The content of the deploy. WSDD file is as follows:
done, unzip and find the Lib directory, add the jar file to your Java project, and you can start writing your Web service. Words don't say much, directly on the code. PackageCom.lovo.domain;Importjavax.xml.bind.annotation.XmlRootElement; @XmlRootElement (name= "Student") Public classStudent {PrivateInteger ID; PrivateString name; PrivateString birthday; PublicS
"Learning notes for the Web Service Li Gang Video"One. Using CXF to develop Web servive server-side (new Java project name Ws_server)//Each Web service component requires 2 parts, interfaces, and implementation classes.
Develo
input and output parameters and other data types. If additional labels are accidentally generated during the above operation, we can also remove them here.
Now, let's go back to manager. WSDL and right-click the source code view and select "Validate" to check the XML document. If any error occurs, modify it as needed.
Well, the WSDL document compiled in graphical form is complete. By the way, multiple methods can be defined, such:
For the sake of simplicity, let's take the defined method as
Introduction to Web Service
1. DefinitionComposed of two parts· Soap-basic communication protocol between Web Services.· WSDL-Web Service Description Language, which defines the information about what the web
case of multiple JVM instances:1, single-machine capacity problem;2. Data consistency issues (what about inconsistent cache data for multiple JVM instances?) , this problem does not have to tangle, since the data allows caching, it means to allow a certain period of inconsistency, so you can set the cache data expiration time to update the data regularly;3, Cache misses, need to back to the source to db/service Request changeable problem: each instan
, Strwebserviceaddr.c_str (), Strrequest, strresult), string form used, the result has been an error, It means that the const char * cannot be converted to a _ns1__proxymiddlewarejobsearch * form, and it should be used in later applications such as the following:_ns1__proxymiddlewarejobsearch Inputparam;//! Represents input_ns1__proxymiddlewarejobsearchresponse Outputparam; ! Represents the outputInputparam.in0 = Const_castAssuming that the interface requires a second parameter, the call is: Inp
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.