I'm learning java networking and i use Socket to create my server. But I know that some technique and frameworks are used in networking programing, such as pool technique ..... Can anyone help me understand it ! Many thanks for anyone help me !
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I'm learning java networking and i use Socket to create my server. But I know that some technique and frameworks are used in networking programing, such as pool technique ..... Can anyone help me understand it ! Many thanks for anyone help me !
Thread moved.
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.
thank you !
Creating a Web Service From Java
One way to create a web service application is to start by coding the endpoint in Java. If you are developing your Java web service from scratch or have an existing Java class you wish to expose as a web service, this is the most direct approach.
The Java API for XML Web Services (JAX-WS) 2.0, JSR-224, relies heavily on the use of annotations as specified in A Metadata Facility for the Java Programming Language (JSR-175) and Web Services Metadata for the Java Platform (JSR-181), as well as additional annotations defined by the JAX-WS 2.0 specification.
The web service is written as a normal Java class. Then the class and its exposed methods are annotated with the web service annotations @WebService and @WebMethod. The following code snippet shows an example:
@WebService
public class AddNumbersImpl {
@WebMethod(action="addNumbers")
public int addNumbers(int number1, int number2)
throws AddNumbersException {
if (number1 < 0 || number2 < 0) {
throw new AddNumbersException(
"Negative number cant be added!",
"Numbers: " + number1 + ", " + number2);
}
return number1 + number2;
}
}
When developing a web service from scratch or based on an existing Java class, WSIT features are enabled using a configuration file. That file, wsit-<package>.<service>.xml, is written in WSDL format. An example configuration file can be found in the accompanying samples:
wsit-enabled-fromjava/etc/wsit-fromjava.server.AddNumber-
sImpl.xml
The settings in the wsit-<package>.<service>.xml file are incorporated dynamically by the WSIT run-time into the WSDL it generates for the web service. So when a client requests the web service's WSDL, the run-time embeds any publicly visible policy assertions contained in the wsit-<package>.<service>.xml file into the WSDL. For the example wsit-fromjava.server.AddNumbersImpl.xml in the sample discussed in this tutorial, the Addressing and Reliable Messaging assertions are part of the WSDL as seen by the client.