Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As we want to quickly see our webservice we implement just a quick and dirty as it can get. At first beware that since its jaxws and Java1Java 1.5 we get annotations for the money:

...

So where is the damm webservice then? Well as we did configure the web.xml to instruct the CXF servlet to accept the pattern /webservices/* we should hit this URL to get the attention of CXF: http://localhost:8080/my-webapp/webservices.
Image Added

Hitting the webservice

Now we have the webservice running in a standard .war application in a standard web container such as Jetty we would like to invoke the webservice and see if we get our code executed. Unfortunately this isn't the easiest task in the world - its not so easy as a REST URL, so we need tools for this. So we fire up our trusty webservice tool SoapUI and let it be the one to fire the webservice request and see the response.

Using soapui we sent a request to our webservice and we got the expected OK response and the console outputs the System.out so we are ready to code.

Debuggings

Okay a little sidestep but wouldn't it be cool to be able to debug your code when its fired up under Jetty? As Jetty is started from maven, we need to instruct maven to use debug mode.
Se we set the MAVEN_OPTS environment to start in debug mode and listen on port 5005.

Code Block

MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

Then we can from our IDE attach a remote debugger and debug as we want.
First we configure IDEA to attach to a remote debugger on port 5005 as:TODO: Starting Jetty in debug mode so we can debug online

Adding a unit test

TODO: CXF unit test

...