How to create a Web service ?
Followed by 5 people
With IDEA 6.0, I searched:
- bundled help
- online documentation
- forums
- intellij.net
but not able to find any documentation on how to create a Web service starting from Java and deploy it on a JavaEE compatible server, for example GlassFish. I could configure GlassFish but what other steps are required to develop/deploy/invoke the Web service ?
Thanks,
-Arun
Please sign in to leave a comment.
Basically when one wants to use GlassFish based web service then it is enough to point to GlassFish install in WebServices plugin settings. After that, just repeat the steps for web service develop/deployment you have done previously.
As to JDK6: when JWSDP2 path is empty and the client module uses JDK6 then generation of web services client stubs will proceed with JDK6 built-in tools.
Nice, I wonder however if web service "autodetection" works in the older versions of the Glassfish (e.g. JEE 5), since if it isn't, then one still needs some additional magic passes :)
Configuring the plugin shows the following window:
http://blogs.sun.com/arungupta/resource/images/intellij-jwsdp-ws-configure.PNG
I don't see any GlassFish configuration here. What am I missing ?
-Arun
Just point JWSDP2 path to Glassfish install
If I select GlassFish build, then Ok button gets disabled.
I'm using GlassFish v2 b33 (https://glassfish.dev.java.net/servlets/NewsItemView?newsItemID=4579).
Weird, plugin accepts Glassfish directory if it contains subdirectory 'lib' that contains 'appserv-ws.jar' containing JAX-WS implementation. This works for JEE 5 install.
Here are the steps as I promised:
http://blogs.sun.com/arungupta/entry/web_services_in_intellijidea_using
Thanks,
-Arun
In GlassFish v2, appserv-ws.jar is replaced by webservices-rt.jar and webservices-tools.jar. This might work for GlassFish v1 but that's not the focus of my study.
Do you think you might be able to add a separate GlassFish v2 line item in the configuration dialog ? I'll be happy to provide support required for that.
-Arun
Ok, will include the support for Glassfish v.2
You can use GlassFish v.2 or JAX-WS 2.1 RI with updated version of the plugin
I'm getting the following error:
-- cut here --
CLI026 Multiple declaration of option "haproperty" in the descriptor file.
Disconnected from server
-- cut here --
Any idea ?
-Arun
Please, add Glassfish specific descriptor in Web Module Settings.
Add unique -context-web-root- value like /myhello
I wonder why sun-jaxws.xml and sun-web.xml, both, are added. Where do you want me to add context-root and can you give the exact fragment ?
-Arun
In sun-web.xml you need to add 'context-root' tag with appropriate value. Result
sun-web.xml looks like following text:
-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/dtd/appserver/sun-web-app_2_5-0.dtd">
<sun-web-app>
<context-root>/myservice2</context-root>
</sun-web-app>
-
JAX-WS RI needs sun-jaxws.xml to have description mapping from context path to web service class.
If you deploy web app interactively via application deployer then all such application vendor specific files are hidden under the cover.
Thanks for your help. I could finally deploy and invoke a Web service using GlassFish v2 in IntelliJ through the Web services plugin. Read about it at:
http://blogs.sun.com/arungupta/entry/glassfish_v2_supported_in_intellij
I could get away without needing the GlassFish specific deployment descriptor.