-
1. Re: Create the simplest WebService possible
karypid Jul 31, 2008 11:05 AM (in response to smmartins)The first thing you need to do is to create a "client proxy" for accessing the web service. JBoss ships with a tool called "wsconsume" that can do this, but it doesn't work for me due to a bug in JBossWS 2.0.1 (this bug is already fixed by the way).
In any case, I suggest you use "wsimport" from the Sun Metro Web Services stack which works perfectly well for me. Get it here: http://java.sun.com/webservices/downloads/index.jsp
What you need to do is run:
wsimport -s /path/to/source/files -d /path/to/compiled/files http://hostname/webservice?wsdl
This will create the source code & compiled binaries for the "proxy client" of your web service.
Then, all you need to do is put the generated classes in your classpath and try something like:public class TestCallingMyWebService { public static void main(String[] args) throws MalformedURLException { MyWSTestService rss = new MyWSTestService(); MyWSTest client = rss.getMyWSTestPort(); // call client.X() methods.... } }
-
2. Re: Create the simplest WebService possible
smmartins Jul 31, 2008 12:38 PM (in response to smmartins)Thanks for your reply karypid.
I've managed to finally build a succesfull web service.
Two important things:
- changed several JBoss libs from place
- Found two really useful web pages:
- http://www.theregister.co.uk/2007/01/23/ejb_web_services/
- http://thesmallpotato.blogspot.com/2007/06/jdk-16-jboss-420-ejb3-web-service-axis2.html
Simple things that Red Hat JBoss developers usually don't do: simple things that work.
Starter developers don't want complex things. They(we) want to start by simple things and then start evolving. JBoss docs never do this.
Sergio -
3. Re: Create the simplest WebService possible
asoldano Aug 21, 2008 5:40 AM (in response to smmartins)Hi Sergio,
I don't want to start a flame, just need to understand how to move to further improve the jbossws docs (which, btw, improved a lot since 1 year ago)."smmartins" wrote:
- changed several JBoss libs from place
Do you mean what is explained here? http://jbws.dyndns.org/mediawiki/index.php?title=Installation (section "Using JBossWS Native with JDK 6)
- Found two really useful web pages:
- http://www.theregister.co.uk/2007/01/23/ejb_web_services/
The fast introduction to the WS world is covered in the pages belonging to this wiki category http://jbws.dyndns.org/mediawiki/index.php?title=Category:WS_Culture.
The development strategies using the tools as well as the client generation and run steps are described here http://jbws.dyndns.org/mediawiki/index.php?title=JBossWS_JAX-WS_Tools.
Do you think something is missing? (maybe a page for real beginners-who-don't-want-to-read-lots-of-pages with a super-slim walkthrough?) Or you did not find those pages, so they should be better advertised / more easily reachable from the doc home page?