Why should we use WSDL4j for developing webservices? - web-services

I need to develop Webservice Application for our Client .
I dont know anything about WSDL4J
From the net I found this
"The Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents.
Is the reference implementation for JSR110 'JWSDL' (jcp.org)."
But anybody please tell me why should we use WSDL for developing webservices?
Is there any specific advantage we will get?
And can anybody please point me a link where to start for working with WSDL4j?

You actually need not to use wsdl4j for developing web services or clients for web services. There are other SOAP stacks developed on top of that. Axis2 is such an open source SOAP stack..
WSDL2Java tool that comes with Axis2 - which been used to generate client side stubs from a given WSDL. uses wsdl4j internally..

Related

Strategy to develop a web service in JAX WS

i'd like your help to designing a wb serice but I don't know how i can't do this.
In fact my application handles data management clients. My application is developped in struts 1.0, spring, weblogic and build-in maven.
He was asked to me to make an evolution because an external application need to access data such as displaying the address of the client or displaying data bank. For this, it was planned to create a web service to retrieve in real time.
I would like to know the strategy to use for designing a web service. Do I need to create a new Dynamite projet maven + JAX WS to my web service and deploy my war on my weblogic server?
Or they have something else to do ?
Thanks a lot !
I am not sure that this question is related to maven.
Adding a WebService (or RestService) could be quite easy with springframework and apache cxf (http://cxf.apache.org/)
see jaxws or jaxrs for more.
create web service in a two types but real time applications using jax-ws web services reason for consumer want to send data into provider.consumer can know the entire information about the provider by seeing its WSDL Document.

Axis2 vs JAX-WS

I have to implement SOAP based web services for a project. We are considering different options like axis2, ejb as a web service, jax-ws but not really sure about the advantages/drawbacks of these options. Can someone please help in this regard.
It would be great if someone can point to any other alternatives for implementing SOAP based webservices.
Thanks in advance,
-Csn
For me, the easiest way to expose a web service is creating an EJB with annotations (JAX-WS) if you are using a Java EE server like JBoss.
Consuming a WS is a bit different but I prefer JAX-WS too, because Axis2 throw exceptions if you use complex parameters (classes) and you add an attribute. JAX-WS instead calls every 'get' and 'set' for the serialized xml. If no 'set' is implemented, no problem.
That's an advantage for backward compatibility.
I would highly recommend to use Apache CXF for developing SOAP web services. This stack is based on JAX-WS but has much more features. CXF has an excellent integration with Spring. There are a lot of documentation on the internet how to create web services using this framework. If I would be working on completely new web service I would definitely choose Apache CXF.

Approaches for creating REST Web services?

i am new to REST Service development. I compared the development mechanism for both REST and WS web services and i found that you can create a WS web service using WSDL file that is the top down appraoch (Correct me if i am wrong) and using bottom up approach also, that is generating the classes manually.
But when it comes to REST web service development you have to follow bottom up approach only that is generating the classes manually. NetBeans IDE provides certain wizards for creating REST web service quickly from databases, entity classes and patterns.
I had also seen when you are developing web service in eclipse and you are using wizard in eclipse IDE, you can create a REST web service from WSDL file. I found this very strange. My question here is what are the approaches we can have for creating REST web services. Can we create REST web services using top-down and bottom up approached. If yes then please provide me details.
Thanks.
It is possible to describe a REST service using a contract. This is the intent of WADL and WSDL 2.0. WADL is specifically a REST contract, whereas WSDL 2.0 evolved from the original WSDL spec. to support all HTTP bindings. Since REST services rely on the use of HTTP methods and headers to exchange messages a WSDL 2.0 contract can work. There is a really good explanation here: http://ajaxonomy.com/2008/xml/web-services-part-2-wsdl-and-wadl
For development of REST services, I'm not sure if NetBeans, Eclipse or other tools specifically support automated REST service from WSDL generation. I would imagine that most are still intended for SOAP service creation. At this point I think WSDL 2.0 and WADL can be used to describe a REST service, but are not intended for automated generation of a REST service.
REST services are simple HTTP request/response,and therefore don't require complex stubs. In most cases it would probably take more time to write the WSDL describing the REST service, than it would take to write the REST service itself.

Combining JAX-WS and JAX-RS

I need to create a web service project that creates some web services and exposes the end points using SOAP and REST. I've done a lot of JAX-RS work but I'm a little light on an JAX-WS implementations. Is there an open sourced technology that implements both?
I would suggest Apache CXF. It is an open source services framework which will allow you to do exactly what you need.

How to get generate WSDL using GroovyWS

I am implementing SOAP web services for a commercial application, and I am using GroovyWS to speed up the development.
But, when I deploy it on Tomcat, I am not using Grails, as the software has it's own J2EE framework, so how I do I get it to react to wsdl requests?
Do I need to write a groovy-based servlet?
Ideally I would like the WSDL generated upon request, so I can easily change the interface and see the change.
It seems I will miss the annotations that JAX-WS provides for, though, to help fine-tune the WSDL.
Using the example web application, the WSDL can be retrieved as follows:
http://localhost:6980/MathService?wsdl