users@jax-ws.java.net

Re: Building JAX-WS 2.0 Services with NetBeans 5.0 and GlassFish

From: Bobby Bissett - Javasoft <bobby.bissett_at_sun.com>
Date: Mon, 09 Jan 2006 14:30:11 -0500

vince kraemer wrote On 01/07/06 12:46,:
> I read through your article and I am a bit confused about a couple
> points.
>
> 1. Why do you create a library that includes ALL of the GlassFish jars?

Primarily for simplicity. However, once the library is created, then you
can use it for any other tools available in the jars rather than making
it specific to just jax-ws. You could trim the list down if you'd like
(until you start running into class not found exceptions), but all that
gets you is a little shorter time when NetBeans parses the jars, as far
as I know.

>
> 2. Why do you add a target to execute wsgen? I thought GlassFish
> does that during its deployment processing, as long as the web app is
> a Java EE 5 web app....

I'll have to check on this -- it doesn't work for me with the files
currently included in the article, but it sounds like there is some way
to do this rather than creating the whole war file (containing the
server artifacts) beforehand.

>
> 3. When I paste the ServiceTest.java code into my editor, I see the
> error squiggles under the imports and other places... Why?

Because it is referencing client artifacts that have not been generated
yet when you first create the file (the comments in the file itself
mention this). When you run the test, wsimport creates these classes and
places them into the test classpath so that the syntax error squiggles
go away.

> Is there
> a way to restructure the workflow so folks aren't seeing this in
> their own development projects/process? I know that I hate to hit
> compile and/or run project when the editor is telling me there are
> errors.

You could "test" the project before creating the ServiceTest class. It
won't actually run any tests since there aren't any yet, but wsimport
will create the classes for you. When creating a web service client
application, you would normally run wsimport and then write your code
(in fact, this is how I wrote ServiceTest.java in the first place). I
didn't want to break the wsimport call into a separate step though,
because it's faster if you can recreate the artifacts and compile the
test at the same time with Alt-F6. If you change something in the
server, for instance, you will regenerate the client bits and compile
the test code in one step.

Cheers,
Bobby