Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 693225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:43:54+00:00 2026-05-14T02:43:54+00:00

I’m learning how to develop SOAP web services with Java. So far now I’ve

  • 0

I’m learning how to develop SOAP web services with Java.

So far now I’ve been following this excellent tutorial

http://web.archive.org/web/20120626005333/http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/

It all goes well, I have my web service working from the command line with it’s embedded server and then, with the help of NetBeans I deployed it on Tomcat.

I’d like to know the steps to manually deploy it on Tomcat, in order to learn how it’s done and because I don’t like depending on an IDE.

I mean, I’d like to know how everything could be done from the command line and a text editor.

I’ve also found this link that explains how to manually deploy a servlet to Tomcat,

http://linux-sxs.org/internet_serving/c292.html

but I couldn’t find any article telling how to deploy a web service.

Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:43:55+00:00Added an answer on May 14, 2026 at 2:43 am

    How to MANUALLY build and deploy a jax-ws web service to tomcat

    I was trying to figure out how to MANUALLY build and deploy a web service for learning pourposes.

    I began with this excellent article

    http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
    (new URL: http://www.oracle.com/technetwork/articles/javase/jax-ws-2-141894.html)

    The idea was to do the whole thing using only a notepad and the command line.

    The only way I could achieve was by deploying a web service with netbeans, and then having a look at the war generated file at \dist\.war (it’s just a zip file, you can open it with 7zip)

    I leave this in case anybody is interested and for documentation purposes…

    If anybody knows an easier way please let me know!!!

    tested on:

    C:\tomcat6\bin>version
    Server version: Apache Tomcat/6.0.26
    Server built:   March 9 2010 1805
    Server number:  6.0.26.0
    OS Name:        Windows XP
    OS Version:     5.1
    Architecture:   x86
    JVM Version:    1.6.0_18-b07
    JVM Vendor:     Sun Microsystems Inc.
    

    saludos

    sas

    1. create the following dir c:\java\src\ws

    2. create thew following file c:\java\src\ws\Adder.java

    // c:\java\src\ws\Adder.java
    package ws;
    import javax.jws.WebService;
    
    @WebService
    public class Adder {
     public double add( double value1, double value2 ) {
      return value1 + value2;
     }
    }
    

    3. standing at c:\java\src\ execute

    c:\java\src> javac ws\Adder.java
    

    file c:\java\src\ws\Adder.class will be generated

    4. create the following directory structure with the following files

    c:\tomcat6\webapps\adder_ws
    
    META-INF
      context.xml
    WEB-INF
      classes
        ws
          Adder.class
      lib
        activation.jar
        webservices-api.jar
        webservices-extra.jar
        webservices-extra-api.jar
        webservices-rt.jar
        webservices-tools.jar
      sun-jaxws.xml
      web.xml
    

    5. copy compiled file

    copy c:\java\src\ws\Adder.class c:\tomcat6\webapps\adder_ws\WEB-INF\classes\ws\Adder.class

    6. c:\tomcat6\webapps\adder_ws\META-INF\context.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <Context antiJARLocking="true" path="/adder_ws"/>
    

    7. c:\tomcat6\webapps\adder_ws\WEB-INF\web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <listener>
            <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
        </listener>
        <servlet>
            <servlet-name>Adder</servlet-name>
            <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Adder</servlet-name>
            <url-pattern>/add</url-pattern>
        </servlet-mapping>
    <!-- not needed
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    -->
    </web-app>
    

    8. Config WEB-INF\sun-jaxws.xml

    file : c:\tomcat6\webapps\adder_ws\WEB-INF\sun-jaxws.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
      <endpoint implementation="ws.Adder" name="Adder" url-pattern="/add"/>
    </endpoints>
    

    9. Copy libraries

    files at c:\tomcat6\webapps\adder_ws\WEB-INF\lib

    copy netbeans files from

    [netbeans dir]\enterprise\modules\ext\metro\*.*
    

    and

    [netbeans dir]\ide\modules\ext\jaxb\activation.jar
    

    10. restart apache

    Shutdown : c:\tomcat6\bin\shutdown.bat

    Startup : c:\tomcat6\bin\startup.bat

    11. Test

    Open a web browser and go to http://localhost:8080/adder_ws/add?wsdl
    you can also use a tool like soapui (http://www.soapui.org/) to test the web service

    that’s it, I guess now I’ll have a look at the way eclipses does it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have text I am displaying in SIlverlight that is coming from a CMS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.