Results 1 to 6 of 6
  1. #1
    toofast is offline Member
    Join Date
    Jun 2012
    Posts
    13
    Rep Power
    0

    Default Creating a Web Service

    Hi everybody, I'm new to Web Services and I've been finding trouble when creating my first one. Before talking about the problem, I'd like to show you the process I followed to see if it's ok. Note that I'm using Eclipse Kepler, Tomcat 5.5 and Axis2.

    1- I created a new Dynamic Web Project.
    2- I created the Java class that implements the service with just one method, a simple one: you pass it a name and it returns "Hi, <name>"
    3- Right click over that class and then: Web Services -> Create Web Service
    4- I go through the next steps (if you need more information about what I'm doing here, please ask). On the last one, I select "Launch the Web Services Explorer to publish this Web service to a UDDI Registry". Click on "Finish".
    5- The Web Services Explorer is launched, but I just get a "HTTP ERROR: 500" message.

    So, I understand that my Web Service wasn't published and therefore it's useless to create a client as it wouldn't connect.

    Am I doing the right thing here? If so, What could be the problem? Thanks a lot in advance.

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    947
    Rep Power
    2

    Default Re: Creating a Web Service

    I am by no means a WS expert, but what about following the JavaEE7 guidelines and annotate a class with @WebService and @WebMethod?
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Creating a Web Service

    Is there a specific reason why you use such an outdated version of Tomcat and Axis2?

    This would be a much smoother operation if you would use Tomcat 7 or up and JAX-RS.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    toofast is offline Member
    Join Date
    Jun 2012
    Posts
    13
    Rep Power
    0

    Default Re: Creating a Web Service

    Well, I could use whatever I want for this kind of tests, for now I'm just learning, but the thing is that the project which I'm going to work on uses prehistoric versions of almost everything (including Java 1.5). I cannot change that, so I think it's better for me to face it since the very beggining.

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Creating a Web Service

    Yep, that's a very good reason indeed. And I feel sorry for you that you are going to be burdened with that.

    Then my next bit of advice is: stop generating stuff through an IDE, start by creating and deploying the webservice "the hard way" so you actually learn and understand how, when and why. Which means: work from the Axis 2 documentation.

    Apache Axis2 -

    What you have to realize here to not get confused is that there are basically two ways to go.

    a) use the Axis 2 API. This means you simply use Axis 2 to do your (SOAP) webservices and you use the Axis 2 tools to generate your stubs. Plain and simple.
    b) follow the standard. Java in general provides a standard for (SOAP) webservices called JAX-WS. If you apply that standard then you are basically free to choose which implementation of that standard you use, and Axis 2 just happens to implement it too.

    Apache Axis2 - JAX-WS Guide

    The online documentation is not bad but I would really stress that you get a good book. Unfortunately I cannot make recommendations there.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    toofast is offline Member
    Join Date
    Jun 2012
    Posts
    13
    Rep Power
    0

    Default Re: Creating a Web Service

    Just when I was about to start with all that, I was told that we're going to use a different production machine and that the tools we're developing will be deployed on WebLogic (an old version, of course). I don't know yet if this is a good change for me, but well, I need to learn a bunch of things anyway.

    I'll ask around here if I find trouble again ;)

Similar Threads

  1. Creating a background service in java
    By prashant in forum New To Java
    Replies: 1
    Last Post: 12-12-2013, 08:28 AM
  2. Replies: 0
    Last Post: 07-08-2011, 09:47 PM
  3. how to call service method inside another service
    By kirtichopra2003 in forum Web Frameworks
    Replies: 1
    Last Post: 10-24-2009, 02:19 AM
  4. Creating a web service from database
    By fiqueudrue in forum NetBeans
    Replies: 8
    Last Post: 01-19-2009, 06:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •