Arun Gupta, Miles to go ...

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Sun Microsystems.
« JSON Pros and Cons | Main | Spring Blossoms »

http://blogs.sun.com/arungupta/date/20070303 Saturday March 03, 2007

Web services in NetBeans 6

I downloaded NetBeans 6.0 daily build from http://www.netbeans.info/downloads/dev.php. The installation went pretty smooth and so after every thing was done, I started the IDE. Before I could do anything in the IDE, an error message window popped up

NPE are just plain ugly but the new feature that I noticed here is "Review and Report Problem". So I clicked on that button and saw:

and once I clicked on "Submit Data", the error message was submitted NetBeans and bug #607 shown in the default browser. Notice that the bug report has all the fields properly filled. If you click on "View Data" then you'll see that a complete report of current operating environment is submitted. However the text that I entered Barring the fact that an error window popped up, I think that is so much better experience in terms of automatically reporting the bug back. The user does not need to be concerned about capturing the relevant details and finding out where to file the bug etc. But the Fortunately the IDE did not crash so I'm able to make further progress.

Then I tried to resize the NetBeans window and the Welcome screen just kept shaking, like an earthquake effect. After I moved the middle bar slight to the left then it disappeared. So I cleaned up .netbeans directory and started NB 6 again to see if I'll see the shaking effect again. But this time it worked fine. I've seen fun programs that will make your entire Windows desktop shake but never by itself :)

Anyway, moving forward. I tried creating a Web service as described in #ws1. Even though I specified the parameter name as "name", the generated operation was:

  // Web service operation

   @WebMethod
   public String sayHello(@WebParam(name = "parameter";)
                          String parameter) {
       return null;
   }

Notice, the generated parameter name is still the default "parameter" instead of the non-default "name". I filed issue #97155 and continued further. And voila, I was able to develop, deploy and invoke a Web service on GlassFish v2 b37 following #ws1 and #ws2 (default client only).

Then I tried creating a command-line based client and added a "Web service client" from a WSDL URL. But no "Web service reference" was added to the project. I filed issue #97156 and then tried the Web-based client.

So then I created a Web client and added a "Web service client" from a WSDL URL. And this time a "Web service reference" was added to the project. Following rest of the steps from #ws2, the Web service client invoked the Web service.

Technorati: NetBeans GlassFish Web services

del.icio.us | furl | simpy | slashdot | technorati | digg |
|
Comments:

[Trackback] After being able to deploy and invoke a Web service using NetBeans 6, I tried to install the latest development build of WSIT plug-in. One big difference (in terms of ease-of-use) I noticed, from NB 5.5.1 Update Center, is that...

Posted by Arun Gupta's Blog on March 05, 2007 at 09:24 AM PST #

[Trackback] NetBeans 6 M9 was released a few weeks ago. One of the new and noteworthy features is Web Services Designer and support for WSIT. In this blog, I'll share my experience on that support. After you've installed NetBeans 6 M9,...

Posted by Arun Gupta's Blog on June 04, 2007 at 03:12 PM PDT #

Thanks Arun,
Your blogs help me a lot. Now i had enough of theory.

I want to create a web service in NetBeans 6.1, and i want to pass objects to my web service.

I want my client to send an object to the web service and the web service will respond with multiple objects(array of objects). How do client take inputs to the object parameters and how do the client knows the object implementation.

How to handle this situation?
do i need to specify the class Implementation in web service and client also?
Itried to include the class implementation as jar file in the add operation window, but this gives a exception while deploying.

Posted by Nilesh Ukey on September 30, 2008 at 02:26 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
« JSON Pros and Cons | Main | Spring Blossoms »

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.