This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes newbie question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "newbie question" Watch "newbie question" New topic
Author

newbie question

Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
i want to start making web services in java.
problem is i don't know how to and where to start.

what do i need to learn first?
what are the tools used to make web services?
is it like programming in jsp or servlets or beans too?
are there any other requirements when it gets deployed?

i hope someone here can help me on this one and guide me

thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
To start, you need a web service engine that runs the services you develop. A common choice is Jakarta Axis running inside the Tomcat servlet engine.

A few introductory article on developing web services with Axis can be found in the Web Services FAQ, which is linked in my signature. Read them, try to get the examples running, try to adapt them to do more complicated things, and feel free to come back here with questions if you get stuck.

Good luck.


Ping & DNS - my free Android networking tools app
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
since you somehow recommended jakarta axis, is that the most best web service engine to use?

what are its advantages compared to the others?
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
i read the faq and unfortunately, i did not understand a thing.
do i have to learn xml to be able to program a web service?
is it not like ordinary java programming?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Some points in no particular order.
  • The first 4 articles under "How do I get started building a web service with Axis" will get you going. If you are in a particular hurry, just read the OnJava article; it will have you running a WS at the end.
  • Will you have to learn XML? Well, a solid understanding certainly helps. You will need to be able to read complex XML.
  • Axis is popular because it's free, and there are many introductory articles about it (like the ones cited in the FAQ). You can also use commercial implementations like WebSphere or WebLogic, which may have better tool support. It doesn't really matter which one you use at the beginning, when you're still learning the basics. Axis is much easier to install, though.
  • And yes, on some level developing WS is like developing any other Java system, but you need to understand what's going on behind the scenes, or you will run into problems later.


  • [ January 03, 2006: Message edited by: Ulf Dittmer ]
    Bernard Sigmund Gustav
    Ranch Hand

    Joined: Dec 20, 2005
    Posts: 170
    so far, i've downloaded and followed the instructions to install axis, and luckily, i've got it running.

    what i'm confused now is, there was soemthing about renaming a sample.java to sample.jws to make it into a web service. so far that works by accessing http;//localhost:8080/axis/services/sample.jws and it runs just fine. so is that it? do i already have a web service?

    but i also read an article in onjava on the fibonacci sample and it was more complicated. like i had to make an interface, then a class and then generate a wsdl file, etc.
    why is that done?
    i mean, can't i just write a normal java program, compile it into a class, then rename the .java into a .jws and then use it as a web service???

    i'm confused
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42371
        
      64
    Yes, you do have WS with the JWS example. But, to quote from the Axis documentation:
    Important: JWS web services are intended for simple web services. You cannot use packages in the pages, and as the code is compiled at run time you can not find out about errors until after deployment. Production quality web services should use Java classes with custom deployment.


    The most important part in my mind is that you do not have a deployment descriptor, which you need to configure all kinds of options that production-quality WSes need. But for starters, and for learning how to write the client accessing the WS, you can use the JWS mechanism.

    The article you mention does not use the JWS facility, it creates a WS by using WSDL, which involves several steps, but creates most of the code you need for you. Trust me, going forward, you will want to do it that way as well.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: newbie question