Wednesday January 31, 2007
Creating and Invoking a Web service using GlassFish in NetBeans, IntelliJ, and Eclipse - Part 2
In this second part of a blog series (part 1), I plan to explore the steps to develop/deploy/invoke a Web service on GlassFish using IntelliJIDEA IDE.
Searching in the help bundled with the IDE on "web service from Java" returned
no results relevant to Web service. I found several (1,2,3)
people asking "How do I develop Web service in IntelliJ 6.x?" but all
the questions are unanswered. The online
documentation does not seem to talk anything about Web service. Searching
on intellij.org gave no results. Finally I found some lead
after searching in the forums but there is no help on "Enable Web Service
Support" as mentioned in the post. Another response
in the forum requires you to add @javax.jws.WebService manually, pretty primitive. So
I decided to ask the question (1,
2) in
the forum.
After discussion in the forum I found that IntelliJ does not support creation of Web services natively but instead support it through a Web service plugin. The plugin, at the time of this writing is "0.6 build 2" with few skeptical comments but anyway worth a try. This plugin supports JWSDP 2.0 so first I'll investigate how Web services can be deployed on GlassFish and then come back to this plugin.
Here are the steps I followed to successfully build and deploy a Web service:
javaee.jar, from GlassFish lib
directory as shown
here.@javax.jws.WebService annotation to the class and add a
method as shown:@WebService
public class Hello {
public String sayHello(String name) {
return "Hello " + name;
}
}
in "GlassFish
Server Settings".http://localhost:8080/hello/HelloService?wsdl.The key point to note here is that no Deployment Descriptors (either standard or application serve specific) are required in the WAR file. The deployed WAR file in GlassFish consists only of the compiled class.
The only way IDEA support creation of Web service clients is through Web Services plugin so I'll explore it in another blog. So the recommended way is to use NetBeans 5.5.1 to invoke the Web service.Enjoy Web services deployed on GlassFish in IntelliJIDEA! And remember, GlassFish v2 uses Web Services Interoperability Technology (WSIT) that gives you interoperable Web services with Microsoft .NET 3.0 framework.
Technorati: NetBeans IntelliJ Eclipse GlassFish Web service WSIT
Posted by Arun Gupta in webservices | Comments[14]
|
|
|
|
|
Today's Page Hits: 4485
Total # blog entries: 1002
Posted by Arun Gupta's Blog on February 01, 2007 at 08:51 AM PST #
Posted by Arun Gupta's Blog on February 05, 2007 at 09:18 AM PST #
Posted by AdvTools on February 09, 2007 at 03:49 AM PST #
Posted by Arun Gupta's Blog on February 10, 2007 at 10:36 AM PST #
Posted by Arun Gupta's Blog on May 01, 2007 at 07:19 PM PDT #
Posted by Logic blog on October 14, 2007 at 12:53 PM PDT #
It will be nice if you write an article about intellij idea 7 + jax-ws 2.1 + glassfish (tomcat is much better), or is there something about them online already?
Posted by Thai Dang Vu on December 13, 2007 at 08:41 AM PST #
http://youradvtools.blogspot.com/
Posted by advtools on December 25, 2007 at 03:53 PM PST #
Hi Arun, thanks for this good tutorial. I have a question regarding the jax-ws SSL support, I configured my application server with SSL support and basic authentication. When running my client, I got this exception... Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:. Any ideas? Any tutorial on accessing webservice from a secured server (SSL) with basic authentication? Thanks in advance.
Posted by cjbaldoza on February 06, 2008 at 02:43 AM PST #
Hello Sir,
I followed the screencast of creating and deploying web service using Eclipse on glassfish. It was very informative as i am new to it , thanks for that.
But when i am running my .jsp file on server ,the glassfish server gets started and it is throwing java.lang.NullPointerException . Do u have any idea why is it so.Please help me resolve this problem
thank you
Posted by Priyanka on October 23, 2008 at 10:53 PM PDT #
Hi Priyanka,
We really need more information to help you figure out why you're getting a NullPointerException. I suggest you post to the users@glassfishplugins.dev.java.net mailing list and we can try to help.
Posted by Rochelle Raccah on October 24, 2008 at 01:17 PM PDT #
Dear sir,
I want complete information regarding how to create deploy and run web service in eclipse europa using glassfish
specifically i need information regarding how to create webservice client for accessing web service
thank you
Posted by Kashmira on November 04, 2008 at 08:48 PM PST #
Kashmira, you can find more details at:
http://blogs.sun.com/arungupta/entry/creating_and_invoking_a_web2
Posted by Arun Gupta on November 07, 2008 at 05:09 PM PST #
Enjoy Web services deployed on GlassFish in IntelliJIDEA! And remember, GlassFish v2 uses Web Services Interoperability Technology (WSIT) that gives you interoperable Web services with Microsoft .NET 3.0 framework.
Posted by BATTERY on November 27, 2008 at 04:50 PM PST #