Can Apache cxf 2.7.10 be integrated with Swagger? - web-services

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...

Related

Creating and using SOAP based web service in Laravel framework

In Laravel 4 framework, how to create a SOAP based web service. I would like to build a SOA based web application in laravel. Please clarify with an example how to use web service with some step by step examples or links as i am completely new to laravel
Thanks in advance..
You can use "php-wsdl-creator" (also supports SOAP). They have a great tutorial and many demo php files to get you started. It can also easily be implemented in laravel or any other framework for that matter. :)
You can find more information on Google Code: https://code.google.com/p/php-wsdl-creator/
Also note that SOAP requires an extension to be loaded in PHP.
For more recent needs, you should use a Project such as wsdl2phpgenerator or PackageGenerator from WsdlToPhp. This sort of projects, requirable with composer, use an OOP approach and allows to build a SOAP request easily with PHP objects then handle the response just as the request with PHP objects.

REST services running on Glassfish

I've developed REST web services using Jersey with NetBeans IDE.
Now I want to provide those services on Glassfish 3.1, without using NetBeans.
I want something like the .aar file that is created when we build web services with Apache Axis2.
Can you tell me how to do it? I have to use the .WAR file, right?
It is something like: http://qallme.sourceforge.net/docs/sec_DeployingAWebService.html ?
Thanks
I could do it by following that tutorial that I've mentioned above.
At first that was not working because of the context-rooton glassfish-web.xml. I had not filled it with the root resource.

Apache CXF 2.7.1 ResponseReader

I'm working through a tutorial that uses Apache CXF 2.6.2 to create a RESTful web service. I installed version 2.7.1 (the latest at the time), because the tutorial indicated that any version 2.6.2 or later would work, and I figured why not use the latest. I am creating the client, and the tutorial directs me to use org.apache.cxf.jaxrs.client.ResponseReader. The problem is that Eclipse tells me "ResponseReader cannot be resolved to a type" and trying to import the class also gives an error. I searched the internet some, and it sounds like ResponseReader is no longer available in CXF 2.7.x. My question is, what is the alternative to ResponseReader in 2.7.x to represent the return value of a REST invocation as XML?
Quoting this web page:
JAX-RS: 3 classes have been removed from the org.apache.cxf.jaxrs.client package: ResponseReader... The first class in the list is not needed with JAX-RS 2.0 Response class...
So, I guess that answers my question. There is no replacement per se, it's just not needed anymore.

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 .

web application creation with apache axis 2 and apache CXF

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.