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.

Results 1 to 4 of 4

Thread: What needs to programing java webservice ?

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default What needs to programing java webservice ?

    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 !


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 688 Times in 675 Posts

    Default Re: What needs to programing java webservice ?

    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.

  3. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: What needs to programing java webservice ?

    thank you !

  4. #4
    Junior Member
    Join Date
    Sep 2018
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: What needs to programing java webservice ?

    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.

Similar Threads

  1. JAva programing
    By swapnilrjn in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 19th, 2013, 03:57 PM
  2. problem of java programing
    By mahnaz in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 16th, 2013, 05:03 PM
  3. Java programing style
    By maple1100 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 5th, 2013, 04:24 PM
  4. Replies: 0
    Last Post: September 21st, 2012, 11:11 AM
  5. Java programing help plz!
    By qazwsx in forum Java Theory & Questions
    Replies: 1
    Last Post: July 21st, 2012, 07:01 PM

Tags for this Thread