Tuesday May 27, 2008

I've recently taken on the responsibility for documenting Facelets and Seam support in NetBeans IDE. The 6.1 plugins have not been tested yet and so are not available from the plugin center, but I was able to build them and run the 5.5 tutorial with only minor changes. If you would like to try this for yourself:
  1. Go to David Salter's blog post and follow his instructions for checking out and building 6.1 Facelets and Seam support plugins.
  2. Run the Introduction to Facelets tutorial.
  3. Let me know how it goes!

Sunday May 18, 2008

Jersey REST API 0.7 contains support for the Spring framework. This post shows how to use NetBeans IDE 6.1 with REST 0.7 to create a web application where a Spring-aware servlet is exposed through both a singleton and a per-request RESTful service. [Read More]

Thursday May 15, 2008

After the long, dank, grey Central European winter, Spring has arrived and with a bang. In the last couple weeks of April, everything flowered and all the leaves came out. True, I spent most of that time trying to get our new tutorials page nice and pretty, at least for web services. And then I was off to the Netherlands and Spain for 11 days, while everyone else was at JavaOne. (The Netherlands was great, and the weather really picked up after our first two days. On the other hand, while Barcelona is a great town, they had record breaking gales for two of the three days we were there.) But I'm back now, and it's May, which is my favorite time of the year in this country and this city. I have more pictures of Prague in general and Vinohrady, my neighborhood on my Photobucket account. You can also see some of my wife's knitting there...

Sunday Apr 13, 2008

It's possible to perform WS-I validation of both WSDL files and SOAP messages using the soapUI plugin, available from the Update Center for NetBeans 6.1 Beta and 6.1 RC 1. soapUI is a leading tool for testig web services, developed by eviware. It's free, open-source software, with a vast feature set that includes Functional and Load Testing for Web Services, Web Services Simulation and Web Service Monitoring. In order to use the soapUI plugin for WS-I validation, you need to download and set up the Interoperability Testing Tool:
  1. Download the Java version of the Interoperability Testing Tool from the WS-I.org Deliverables page.
  2. Unzip the tool into the location of your choice.
  3. Create a WSI_HOME environment variable set to the location of the unzipped Interoperability Testing Tool.
  4. Open the IDE and navigate to Tools > soapUI > Preferences. Open the WS-I Settings tab and, in the Tool Location field, enter the location of the downloaded and unzipped wsi-test-tools folder. Select other options according to your preferences and click OK.
To validate WSDL files, right-click the binding node in the Web Service Tests node and select Check WS-I Compliance.

To validate SOAP messages, first monitor a SOAP request and response, as follows:

  1. Find the binding node in the Web Service Tests node and expand it to show the requests.
  2. Right-click a request and open the Request Editor, described in soapUI documentation.
  3. In the Request Editor, send a request and wait for the response.
  4. Right-click in the response window and select Check WS-I Compliance.
Each WS-I report opens in its own tab. The report is saved automatically if you set a location to save reports in the soapUI preferences. You can also save the report manually by clicking the Save icon above the body of the report.

You can see the test configuration used to generate the test report in the Config tab. SOAP message test reports also have a Log tab, which is an XML log of the request and response SOAP exchange.

Saturday Mar 15, 2008

Those of you with an interest in NetBeans Axis2 support will be glad to hear that the Axis2 plugin is available again from the Update Center. Not that I've seen it there--I installed the latest "All" bundle of 6.1 development, and Axis2 support was already present. You'll also be glad to hear that libraries in the NetBeans project are now copied to the Lib folder of the AAR file. Milan is hoping to change the Axis2 feature to support remote server deployment. The way he'd like to do it would simplify Axis2 support in general. However, we don't know if this will be done in time for the release... REST 0.6 and SOAP UI are also now supported. More about them later, after I've had a chance to investigate further.

Tuesday Feb 26, 2008

I have to write a tutorial for Axis WS support in the upcoming NetBeans IDE 6.1, so I got a series of instructions from Milan Kuchtiak, the engineer in the know, and got to it. Here's how it went:

Step 1: Download and install Axis 2. Well, that's easy enough, it's just a ZIP file. I see there is also a WAR file that I can download, but Step 2 is building the WAR file, so let's follow the engineer's directions and just download the zip and unzip it somewhere, say C:/ root.

Step 2: Run the build script in the Axis2/webapp directory to create axis2.war. Splendid, although there is no build script, just a build.xml. Wait, if there is a build.xml, then I can build it with ANT. Do I have ANT on my classpath? ... Nope. Have I installed ANT? ... Evidently not. So I install Jakarta ANT, put it on my PATH, and Bob's your uncle, or my uncle, or something. I wish I could write "...and Bob's your uncle" in an official tutorial. Anyway, ANT runs and I get my axis2.war file.

Step 3: Copy axis2.war to the J2EE server webapps directory. I copy it both to TOMCAT_HOME/webapps and GLASSFISH_HOME/domains/domain1/autodeploy.

Step 4: Start IDE.

Step 5: Install the Axis2 nbm plugin file. Milan sent me one as an email attachment, but the 6.1 distro I installed already had it as an available plugin, so that was easy.

Step 6: Go to Tools -> Options -> Axis2 -> Runtime and type in the Axis home directory. Easy enough.

Step 7: Still in the Axis2 Options, switch to the Deployment tab and enter the path either to the Tomcat Axis2.war or the GlassFish Axis2.war. I choose Tomcat since Axis is supposed to work a little better on that server. Milan's advise was to enter the path to the TOMCAT_HOME/webapps/axis2 directory, to which Tomcat unpacks the WAR, rather than the WAR file itself. However, I couldn't find an axis2 directory so just typed in the path to the WAR. Later I found out the significance of this absence...

Step 8: Enter the Tomcat Manager username and password. Fine, except that first I have to find out what they are. Milan said that they are in TOMCAT_HOME/conf/tomcat-users.xml, and he sent me an example of the file. It's a good thing he did, because my tomcat-users.xml is empty. I copy Milan's file into mine, and now I have Manager username "tomcat," password "tomcat."

Step 9: Create a new Java Library project. OK, I name it AxisBoldAsLove. Note to self: Do not make Jimi Hendrix references in official Sun tutorials. I create a myaxis package in the project.

Step 10: Create an empty Axis web service from Java in the project. I choose New -> Other -> Web Services -> Axis2 Service from Java and select "Empty Web Service" from the wizard. I put it in the myaxis package. Well, hurrah! I get an Axis Web Services tab in my project, with the NewAxisFromJava WS (hmmm, I should have selected a name), and the NewAxisFromJava.java class in my source package. Terrible name.

Step 11: Implement the service class. Well heck, I can't open the Axis web service, so I guess I should change the .java class. That however already has some "Hello, World!" output specified by default. Maybe I don't need to implement anything?

Step 12: Deploy the service. I right-click the service and select Deploy... OK, I get a BUILD SUCCESSFUL message, but nothing on the Tomcat log. That doesn't seem right.

Step 13: Check that service is at http://localhost:8080/axis2/services. Er, I have a 404 error. Well, I delete my project and try everything again. Another 404! In fact, I have a GlassFish 404 error. Ah-ha, GlassFish is helpfully occupying 8080 and Tomcat is on 8084. OK, change the Axis options and the service properties and everything else I can think of to 8084. Now Deploy again. Says BUILD SUCCESSFUL again. What do I get at http://localhost:8084/axis2/services? Another 404 message! *groan* At least it is a Tomcat 404 and not a GlassFish 404.

OK, Milan's gone but Lukas Jungmann listens to my woes. We go through my project. And here's the nub: I should have copied axis2.war to the Catalina base, which is in Documents and Settings/Jeff/.netbeans, not to TOMCAT_HOME. Well, bloody hell, I copy it to CATALINA_BASE.

Still a 404 error! Lukas scries my log and sees that when I redeploy the WAR file, I'm still redeploying the one in TOMCAT_HOME. So we look at Tools -> Options -> Axis2, and sure enough, it's still pointing to the TOMCAT_HOME WAR file. So I change that, redeploy the service and generate a WSDL file.

Success at last! Everything is where it's supposed to be, and a JAX-WS client can be created based on the WSDL file.

Well, dear reader, by the time you see my tutorial this process should be simplified somewhat. Step 6 is already obsolete, because Milan has received permission to include the Axis libraries directly in our plugin. I'll try to play around with the service code a bit to see if I can make it do anything interesting, but really there's not much to it. All the operations appear to take place in a standard Java class, and that class is then exposed as an Axis web service. To change the operations, you change the java class and these changes are automatically reflected in the Axis web service. Milan's added subnode display to the web service in the project, so you can watch the operations get added to the web service in real time! After changing the service, you of course have to redeploy it, and then whoever is running the client has to refresh it.

Monday Feb 25, 2008

Since food is one of my great pleasures, I thought I'd share the occasional food post with you. On Sundays, my wife and I have the custom of going to the huge Vietnamese market complex in Malesice. Aside from the household supplies and countless dodgy textile stores, they have a couple of Asian grocers that actually sell fresh green stuff (hey, this is the Czech Republic) and some luncheon places that mainly serve the market workers. We usually go to the one at the end, where we sit huddled over a formica-topped table and watch Vietnamese state TV while having a big bowl of pho ba (beef noodle soup w broad rice noodles), or construct-your-own bun cha (crispy barbecued pork belly, not greasy at all, in a marinade, along with a bowl of rice vermicelli and a plate of greens. You spoon the marinade on the noodles, break up some greens on top and eat it with a slice of pork belly.) This Sunday we had enormous bowls of bun ca, fish soup with rice vermicelli. They make it from carp, the local cheap farmed fish. Normally I avoid carp as it is rather muddy and has a mushy texture, but the soup is made from tiny crispy fried bits of carp, in a broth with hot peppers, tomatoes, dill, onions, garlic, and scallions.

The pink lump in my bowl was a big cake of fish roe. I don't know if it was carp roe, which I never would have thought about eating, but it was certainly edible, whatever fish it was. Probably carp just due to the size. I shared my roe with Eve, who never met a fish egg she didn't like. Note also the condiments on the table, including a bowl of crisp fried onion and hot pepper in oil (white bowl in background), which makes pretty much anything delicious.

By tradition, Friday is a cat blogging day, but as usual I am days behind everything, so you get it on a Monday.

That is Kocic, our miniature black cat. 6 years old and no more than 2.8 kg. That's just as big as she gets. She's a very affectionate and well behaved animal, except when she's hunting our toes, or when she decides to get our attention by sinking her fishhook-like claws into us.

Friday Feb 15, 2008

Thanks to Blog SPOT Blog for this cool-in-a-geeky-way YouTube video showing how to integrate Sun SPOT sensors with web services for industrial automation.

Friday Feb 08, 2008

As you may know, the version 0.5 RESTful Web Services plugin for NetBeans IDE has been available since 18 January. I've already updated the snippets in relevant tutorials. The most visible changes in the API are:
  • Replacement of the @UriTemplate annotation with the simpler @Path.
  • The @HttpMethod annotation has become a meta-annotation, with the following changes:
    • @HttpMethod("GET")-->@GET
    • @HttpMethod("POST")-->@POST
    • @HttpMethod("PUT")-->@PUT
The deployment and complilation processes have also been simplified. For more details, see Paul Sandoz's blog. Releases of Jersey and the NetBeans REST plugin are related to the JAX-RS release schedule. The Jersey release schedule is available here.

Tuesday Feb 05, 2008

There's a new web services tutorial up, based on a demo posted on Arun Gupta's excellent blog. This tutorial shows you how to set up NetBeans IDE to access a MySQL database and then expose database fields as RESTful web services, via entity classes. The tutorial is called Consuming a MySQL Database in a RESTful Web Service. It makes a good follow-on to Connecting to a MySQL Database and Getting Started with RESTful Web Services on GlassFish.

Friday Feb 01, 2008

My team members are starting to link relevant community contributions from our documentation index pages. If you look at the web services documentation home page, you'll see the new category Community Contributions with the very first contribution, Kristian Rink's Web Services with NetBeans (for Eclipse users). This is the first part of what I hope will be a series about how much better it is to develop web services with our IDE instead of someone else's. Anyway, if you think of any cool demonstrations of developing web services on NetBeans IDE, do please post to http://wiki.netbeans.org.

Good news for those of you who have struggled trying to deploy the Getting Started with RESTful Web Services tutorial on the bundled Tomcat AS. No more digging about on netbeans wiki. I've combined the configuration instructions on the wiki with the existing tutorial, and created the new Getting Started with RESTful Web Services on Tomcat tutorial. The original tutorial is now titled Getting Started with RESTful Web Services on GlassFish.

We've been having some trouble building the new tutorial's project on linux boxes. These problems are related to known issues about library definitions on linux (Issues 126339 and 115947 for those of you in the NetBeans IDE community). If you have a linux box and use this tutorial, please let us know how it went.

For that matter, any and all feedback would be welcome!

Monday Jan 28, 2008

Well, hello, everyone! My name is Jeff Rubinoff and this is the end of my first month at Sun. I'm a technical writer on the NetBeans team, covering web services functionality.

I got my start in technical writing in 2002, working for Systinet. That's a name some of you will recognize. I was in charge of the WASP Server for Java doc set (later Systinet Server for Java), all 700+ pages of it, in DocBook source. When I started, I had never heard of XML in my life, and Java was an island in Indonesia, famous for its coffee. Later, as Mercury Interactive acquired Systinet and then Hewlett-Packard acquired Mercury, I moved over to the new SOA Systinet product. But after 5 years I was ready for a change, and when a position opened up on the NetBeans team, I decided to take it.

I knew a little about NetBeans from back when Systinet Developer supported it, although I had more experience with Eclipse. NetBeans has certainly improved leaps and bounds from those days, as has web service technology in general. When I joined Sun, I hadn't looked at web service creation since 2004, and I was immediately impressed with the convenience of J2EE 5 annotations in JAX-WS. In my day, when we wanted to deploy a web service, we had to create a deployment descriptor, and edit it by hand, and carry it uphill through the snow for 5 miles, without boots!

Since I am so new to the job, you can help me help you. What is missing from our tutorials or product Help that you would like to see? Is there anything about our page designs that you think could be improved? Send me a comment!

Also, have a look at my blogroll. It includes a bunch of NetBeans tech writing and web services veterans. It also has one or two people who have nothing to do with web services, but might interest you anyway...

This blog copyright 2009 by Jeffrey Rubinoff