Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Web Services - Beginner

Options
  • 18-01-2009 6:45pm
    #1
    Closed Accounts Posts: 5


    Hi,

    I currently have a prototype standalone java app that contacts a remote webservice to check for new messages. It retrieves and stores them in my local db. I have this request repeating every few seconds on a timer. I would like to change my architecture before continuing with development. I would rather a notification system rather than current polling on timer.

    The service provider (the people whos inbox i check for messages)provide a 'push' service which requires me to set up a simple web service that I publish and they notify me if I have a new message. They provide a template of the webservice I need to write and its quite simple.

    My question is what is the best way/best practice for getting the new message from my new webservice to my standalone java appl. Does my app now have to poll my webservice for a message or can i give my web service a reference to my app? How would I do this?

    I completed a simple tutorial web service at, http://www.builderau.com.au/webdev/soa/Setting-up-a-simple-Web-service-using-Java/0,339024680,339284524,00.htm

    just to get used to web service file structure etc. The client has a reference to the service using the stub, is there a similar way to provide/generate a stub/skeleton to the webservice so that it can pass the message on to its client? Is this normal procedure?

    Alternatively, could I just put all the current app logic/db access etc in classes in the webservice either? Would this be usual? I am guessing its probably better to leave the service lightweight and just pass on the work elsewhere?

    Anyway, as you can see I relatively clueless when it comes to webservice design and development. All help welcome.

    Thanks in advance,
    T


Comments

  • Closed Accounts Posts: 5 toriacht


    Since I posted I have continued to test/develop and increase understanding.

    I have integrated my application with the simple web service by including them in the same Java Resources e.g. src folder as the published web service.


    Is this the correct architecture/approach to take?

    This is currently only running within Eclipse. When I deploy this to a live server I presume my current JDBC connector will work fine for access to DB form java classes? I don't need any extra Tomcat plug ins?

    Thanks,
    T


  • Registered Users Posts: 155 ✭✭tammy


    You shouldn't need any extra tomcat plugins. Your client has to operate on the data it receives from the service so what you've done makes sense. SoapUI is very handy for testing web service requests and responses, you can do the same thing via eclipses web services explorer but it's kind of clunky.


Advertisement