Normally I go for top-bottom service creation(e.g. write wsdl, then generate a service based on it)
now I need to generate a service in a bottom-up - what would be the best tool for it?
I have an old guide which describes generation of ws using Sun Java Studio Enterprise - it does not exist anymore as I may see... so what is the substitution?
I use Apache CXF for creating and using web services. It's really easy to use and I have never had any big problems with it.
You can use Java API for XML Web Services (JAX-WS) for create Web Services. JAX-WS uses annotations to simplify the development and deployment of web service clients and endpoints. JAX-WS can be used in Java SE starting with version 6.
There is several JAX-WS implementations:
Apache Axis2/Java
Apache CXF
Metro
You can follow the JAX-WS Five Minute Tutorial of Mohammad Juma. And, why not, Deploy JAX-WS Web Services On Tomcat.
For NetBeans and Glassfish, you can see Getting Started with JAX-WS Web Services. On eclipse, you can see Step by Step tutorial to create a JAX-WS with Eclipse, CXF and Glassfish V3.
Related
I have one query regarding wsgen and WSServlet.
wsgen tool is used to parse an existing web service implementation class and generates JAX-WS portable artifacts for web service deployment.
Also if I am deploying my JAX-WS webservice on tomcat, I can make use of WSServletContextListener and WSServlet to deploy my webservice (I am using sun-metro implementation).
So my confusion do both are doing the same work, or one have advantage over other in some specific scenarios?
Please suggest.
I am trying to call a web service from java. I am using JBoss as the client application server. The Web server is written in jax-ws and is running in some other server (which i dont know).
My requirement is to call the web service from my application running in JBoss. After doing enough search, I found that, jax-ws is a Standard and now included in jdk. Metro is a reference implementation of jax-ws and is provided in the Glassfish App server.
My Question is: -
Is there any other jax-ws implementation present in the market?
Just like each container provides its own implementation of Servlet API, do all of them provide implementation of Jax-ws?
Do I need to copy the Metro api to my Jboss application?
Where does JBossWS comes into play here?
A sample code provided by the Web Service host specifies that, the client needs to have to add a authentication token to the SOAPHeader, and in the sample code they have used com.sun.xml.ws package.
When I used MessageFactory to create a new SOAPMessage, will it use the Metro RI or JbossWS?
If Metro is glassfish's implementation of Jax-ws, then will it run in other app servers?
Added to that, my application exposes another Web service also (although it uses Axis 1).
I am getting a bit confused regarding this.
Can someone help me with some details regarding jax-ws, Metro, JbossWS. And where do each of them stand.
JBossWS is the Web-Service stack provided by the JBoss Application Server, and yes, it is also an implementation of the JAX-WS standard. As far as I know, JBossWS is based on Apache CXF.
Glassfish uses another implemetation of JAX-WS, Metro.
In order to communicate with a remote WebService (the implementation is not important, as long as it uses standards), you can simply use JAX-WS api and any Application Server which provides an implementation for it. JBoss does, so you have just to write your client following the JAX-WS api (and it should run on both JBoss and Glassfish or any other JAX-WS compliant container).
About the authentication, you should provide some more information, since there are a lot of options in the standards here.
Is there any excellent tool in JAVA to deal with webservice or wsdl?
Yes. There is a standardized API (JAX-WS) that is even integrated into the Java standard API (the javax.xml.ws packages) since Java 6, and multiple implementations thereof, such as Axis and CXF.
Read about wsimport utility, which generates client-support code from the WSDL document (or URL pointing at service endpoint).
If you are using Eclipse try Eclipse Web Tools Platform Project, it's good at my point of view and sufficient for me.
For IntelliJIDEA Web Services link
If you're a Spring user, I'd recommend the Spring web service module. It makes using WSDL, creating web services, and implementing clients easy.
I've been going off of http://www.oracle.com/technetwork/articles/javase/index-137171.html and downloaded the files but I'm a little lost since I've never done this before.
I've installed Tomcat and Eclipse Java EE IDE but I don't know what kind of project to use to create a webservice and how to load and compile the code to the service.
Am I going about this the right way in using eclipse?
That article is old. Since then, the Java standards committee created a new API named JAX-RS (The REST counterpart to JAX-WS). Like JAX-WS, this is meant to standardize REST web service layers.
Its reference implementation is Jersey, which supports JAX-RS 0.8, 1.0, and 1.1.
I understand that Apache CXF has support for JAX-RS 0.8, but it is unclear about 1.0/1.1 support.
JBoss has RESTEasy. However, it is not immediately clear which versions of JAX-RS are supported by RESTEasy.
Another popular JAX-RS framework is Restlet. Unfortunately, I can't open their site from here to say which versions of JAX-RS they support.
Here is an REST (JAX-RS) example I put together. You will probably find part 4 the most helpful:
Part 1 - The Database
Part 2 - Mapping the Database to JPA Entities
Part 3 - Mapping JPA entities to XML (using JAXB)
Part 4 - The RESTful Service
Part 5 - The Client
If all you're creating is a lightweight RESTful service you can also look at GlassFish which provides a simple http server for REST.
You'll create a web project to deploy a web service of any kind. It'll be packaged in a WAR and deployed on Tomcat.
I am gonna implement web service in Java but before implementation I will decide which framework I should use. Simplicity and running on JBoss 4.2.3 Platform are the requirements.
What is your suggestions?
Instead of using an additional technology stack component, why not use the #WebService annotation introduced in EJB3. JBoss 4.2.3 supports EJB3
Two examples
Using EJB3 Web Services guarantees that you web services will run on any Java EE compliant server without any modifications to the server.
Since JBoss provides JavaEE features, you can simply take a look at JAX-WS, annotate your EJBs, and let JBoss handle everything from there.
Otherwise you can look at Apache CXF and for JBoss + CXF see here
Axis2 on Tomcat 6
JAX-WS on Tomcat 6
Quick, Fast and Easy