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: 2438
Total # blog entries: 1002