web application creation with apache axis 2 and apache CXF - web-services

what is the different between apache axis 2 and apache CXF?
And what are the web application fomat of those(war,or jar etc...)
And where can I begin to write a we application with apache CXF?
could u plz define some tutorials to learn this??

For the first part, see:
Difference between Apache CXF and Axis
For the second question: CXF is very flexible. You can use a JAR, WAR, OSGi bundle, a "main method" class, Spring context, blueprint, etc.... There are lots of options depending on what works best for you.
There are a lot of tutorials and such at:
http://cxf.apache.org/resources-and-articles.html
to help get you started and there are several example in the CXF download as well.

Related

Can Apache cxf 2.7.10 be integrated with Swagger?

I have developed Restful web service using Apache CXF 2.7.10. I am trying to integrate same with Swagger (and Swagger UI). I couldn't look up an example over the internet for the same. All the examples point to recent versions of Apache CXF.
Is the integration with Apache CXF 2.7.10 version possible? If so, can anyone please point to the steps or a working example for the same?
Note: My application is regular maven based project.
Thanks!
Why not upgrading to CXF 3? Everything is implemented there and easy to use: http://cxf.apache.org/docs/swagger2feature.html
Should be possible to backport the stuff to 2.7.x. You would need to add swagger-jaxrs dependency and customize the ApiListingResource (https://github.com/swagger-api/swagger-core/wiki/swagger-core-jax-rs-project-setup-1.5.x). I guess upgrading to CXF 3 would be much easier...

What are main components of webservices to be learned ? And how to deploy a webservice on servers such as Apache etc?

I am new at webservice and i want to know where and when should webservices be used and exposed?
And what it takes to deploy and use webservices (wsdl file) on Tomcat or any other servers ?
Thanks.
From technology agnostic things the important knowledge is the stack composition: WS-(Servlet)-HTTP-(TLS)-TCP/IP (optional layers in parenthes). As a platform you typically try some lightweight option like Jetty or Winstone before falling back to the Apache Tomcal.
If you are after any webservice now, then a wise thing to do is just pick some mature Java standard technology like JAX-WS. There will be a good tutorial on java.net, respective Maven packaging and deployment plugins and IDE integration rigs. Once you have a simple thing working you'll have more specific questions most answered on SO.

consuming wsdl in spring mvc

My IDE set up is
Eclipse Indigo
Spring IDE for indigo
Spring STS for indigo
maven integration for eclipse
maven integration for eclipse wtp
Created a sample spring mvc project and performed maven clean and maven build.
I have a wsdl from client which i have included in a project that uses cxf-wsdl2java to generate the proxy code. Not sure if this is the right way to approach this. The web service is on 'axis'
Looking for tutorial on how to consume the wsdl and make the method calls in spring mvc project using maven. also is cxf the right way to approach this? particularly the wsdl2java approach
It is usually a good practice to use the wsdl2java with maven (except that I would have not copied the wsdl inside the resources, but I would have kept it on the distant server). As this if the wsdl change, you will ne notified directly with your build.
For your client, just configure your endpoint. see the 'Configuring a Spring Client' doc from cxf : http://cxf.apache.org/docs/jax-ws-configuration.html
You might want to look into the Spring Web Service project found here:
http://static.springsource.org/spring-ws/site/
Ihere is a tutorial (located here: http://static.springsource.org/spring-ws/site/reference/html/tutorial.html) on their website which goes through both creating a contract first web service, as well as a consumer of that web service.
Hope this helps!

Webservice, Axis & OSGI (knopflerfish)

I first warn you because I'm a beginner. So, I don't know if I'll be specific on all points. Here is my problem:
I have a wsdl file. Currently, I use Tomcat and Axis to deploy it. So for that, I use the wsdl2java tool of axis that generates me the "skeleton" of the webservice. And then I write on the generated files the code of the various methods of the webservice. Finally, I deploy the webservice on tomcat with Axis. Everything seems to work more or less.
The problem is that I want to deploy this webservice using the bundle axis of osgi (knopflerfish). But I don't know how to do it.
Should we use again the wsdl file and generate a code with a tool like wsdl2java but adapted to knopflerfish? or should I use the "skeleton" that I've created before with Axis and adapte it for osgi? And generally speaking, how can we use the axis bundle of knopflerfish?
To be honest, I do not find many things over internet about it. So that's why I write to the community :(
Thank you in advance for your help.
Found a article on http://www.ibm.com/developerworks/webservices/library/ws-OSGi/ for deploying a Webservice as OSGI bundles. This uses Eclipse Equinox as the OSGi container and Apache CXF as a web services framework and its deployed in Apache Servlet Container.Hope this meets requirement of depolying Webservices as OSGI service .

Create SOAP message from WSDL using axiom

I'm a starting a project which consist in sending a request to a web-service (which is already available) and parsing the response. I have the WSDL and URL endpoints. Does anyone have a startup tutorial on how to build something from there?
I would like to use Axis2 + Axiom to send the service request and receive and process the response. I'm using eclipse as dev env. I've been search for a tut on how to do this but with no success.
Any suggestion would be greatly appreciated!
this might help you
creating a webservice client using eclipse
I don't know about Axiom, but SOAP UI is a terrific tool for testing web services in just the manner you describe.
I don't know if Eclipse has a plug-in for it. (They do for everything else.) IntelliJ supports it, so that's how I use it.
Well in conclusion, I did find two very useful links for the Apache axis2 project, got it working in no time!
A deep explanation Invoking Web Services using Apache Axis2:
http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.html
For code generation from WSDL:
http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html