Web Service Vendor Framework

One of the most hidden features of NetBeans IDE 6.0 is... a framework for web service providers to integrate their web services into the IDE. To understand what that means, look at this screenshot:

I added the Daily Dilbert web service from eSynaps to the palette. (The other ones you see above are there by default.) The palette only contains these web service items if (1) you have the RESTful Web Service plugin installed and (2) an appropriate REST resource class is open in the editor.

How did I get that Dilbert web service item into the palette? Many many NetBeans API classes? Much digging through code? Pulling of hair from head? No. I looked at the WSDL file that defines the Daily Dilbert web service. Then I created an XML file with exactly this content (using the information gleaned from the three links I provided in yesterday's blog entry):

<?xml version="1.0" encoding="UTF-8"?>

    <description key="DailyDilbert_Desc" 
        <icon url="com/esynaps/services/nbcomponents/dilbert-16.png" size="16"/>
        <icon url="com/esynaps/services/nbcomponents/dilbert-32.png" size="32"/>
    <service name="DailyDilbert">      
        <method name="DailyDilbertImagePath" 
                serviceName="DailyDilbert" portName="DailyDilbertSoap" 
                This operation provides a path to a Daily Dilbert image.

I created a new module project, put the above XML file into the module source structure, and then registered it in the layer file like this:

<folder name="RestComponents">
    <folder name="Esynaps">
        <file name="DailyDiblert.xml" url="DailyDiblert.xml"/>

And that's all. I needed to restart the IDE, and then the Dilbert item was in the palette. Now, what does that item do for me? When I drag it into a resource class, I see the following:

There are no parameters that need to be filled in for the Daily Dilbert service, hence no parameters in the dialog above. ("Wait a minute!", you should now be thinking. "When did you create that dialog?" And the answer is: I didn't. I only provided a module with the XML definition above and the layer registration. The framework provided under the hood by the IDE does the rest.)

What happens when I click OK? A new resource class, called DailyDilbertResource is created. Plus, in the class where I dropped the item, a small stub method is created, for retrieving the resource:

 \* Returns DailyDilbertResource sub-resource.
public DailyDilbertResource getDailyDilbert(@UriParam("customerId")
Integer id) {
    try {
        return new DailyDilbertResource();
    } finally {

Next, I discovered that I could use the "Test RESTful Web Services" functionality, to try out my Daily Dilbert integration in the IDE:

This is all pretty cool. What is missing here, of course, is a wizard. The vendor should be able to create a module project and then use an "apisupport" wizard (i.e., a wizard from "Module Development" in the New File wizard) to simply choose a WSDL file. The wizard would then extract the necessary information, create the XML file, and register it in the layer. Once we have that, vendors will be able to integrate their web services in the IDE while drinking their coffee on a Monday morning while still recovering from the weekend. In other words, without needing to think.


That's sweet. I could be wrong, but it strikes me as being a more appropriate KISS way to go within SOA, having been drowned before in Oracle's mega-complex SOA frameworks/tools/stacks.

What would be really nice is if companies could run their own NetBeans update center (cascading on the official ones, a kin to Maven) and push out new service components which would automatically show up in the palette for all developers. This could be done for other components too of course, Swing, JSF etc.

Posted by Casper on January 11, 2008 at 12:10 AM PST #

Thanks Casper, I like this too. And your 'push' idea is interesting.

Posted by Geertjan on January 13, 2008 at 04:09 AM PST #


Posted by guest on January 16, 2008 at 09:38 AM PST #

How can I do something like this for RememberTheMilk? I can't seem to get at their WSDL and I think they don't have one.


This is their API endpoint. I have an API key and I can get responses for at least the echo method (in FireFox), but I'm not sure how to do anything with this in NetBeans.

I'm new to this. :)


Posted by Thomas G Henry on February 17, 2008 at 07:52 AM PST #

Hi Tom. Exploring this now and I will hopefully blog about it today.

Posted by Geertjan on February 17, 2008 at 02:42 PM PST #

Excellent! Thanks. I look forward to seeing what you come up with.

Posted by Thomas G Henry on February 17, 2008 at 11:05 PM PST #

Thomas, they don't seem to have made a WSDL available, so there's nothing I can do to integrate with them. They seem to have a Java API in the works, but I don't know anything other than that.

Posted by Geertjan on February 17, 2008 at 11:29 PM PST #

That explains it.

Thanks, anyway.

Keep up the good work!

Posted by Thomas G Henry on February 18, 2008 at 12:48 AM PST #

I tried to show Remember The Milk at: http://blogs.sun.com/blog/entry/remember_the_milk ;-)

Posted by Lukas Jungmann on May 30, 2008 at 04:38 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« June 2016