Webservice, Axis & OSGI (knopflerfish) - web-services

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 .

Related

Have WSDL, need to generate services (step by step instructions)

Any documentation on creating a service and deploy to JBoss from WSDL? I have found several on the net, struggling to choose the correct/optimal approach. Using spring is also okay.
I have created WSDL from eclipse based on my requirements. Now, How do i generate request/response from WSDL? and then stubs. I also can use Intellij if it simplifies things.
I did generate a service, but i had to strip out so many jar files (jboss related) from my ear file before deploying to make it work. Any help generating ear file will be helpful too.
JDK 1.6; JBoss 5.1; Eclipse Indigo or Intellij Idea (11.1.4)
I know this question has been asked several times, but as i mentioned tons of information on the web, getting confused with several approaches.
If you are using Maven, you can use the jaxws-maven-plugin to generate artifacts. You can find a simple maven project for generating artifacts from a WSDL, here (wsimport)
Step-by-step:
Generate Java artifacts from your WSDL. (Use wsimport tool or Maven plugin)
Implement the generated Service Endpoint Interface.
Deploy.
If you want to start with Spring-WS, the obvious starting point is the documentation. You probably want to use a marshalling framework like JAXB to generate classes based on your WSDL. Based on those classes you can create #Endpoint annotated classes. In such an endpoint, you can create methods which are annotated with #PayloadRoot and #RequestPayLoad - based on that combination it will be mapped to a specific operation in the WSDL. Check out this page in the documentation for more information on annotating methods.

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!

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.

Deploy Axis2 webservice on older Axis

i have deployed a web service on Axis2 .. the generated interface is .aar filem i am trying to deploy it on an older axis version that takes .wsdd files .. how can i do that ?
thanks a lot
Axis and Axis2 services are not compatible.
You will have to take your classes that you wrote for your Axis2 service, put them into an Axis project, and write the appropriate .wsdd file, and perform any other necessary code or configuration changes.
:(

How to deploy an Axis-generated soap service to an embedded Tomcat instance

I generated a Soap Service from a WSDL and now I need to deploy it to my existing application which uses embedded tomcat (I.E. I have a class which extends TomcatServeletContainer and a main class which instantiates that class and starts the server).
I see many examples for how to deploy an axis service to a standalone tomcat using a WAR, or a WSDD, but I don't see how to wire it together myself. I assume I have to define a servelet in the web.xml and provide some other glue. Any assistance or pointers to appropriate documentation would be most appreciated.
Thanks!
-Carl
Have you been able to get this to work?
I've been trying to build a webservice (in a standalone war-file containing the axis jars (w/dependencies)+server-config.wsdd) using maven. I really don't want to make any calls to the AdminClient at all (meaning not to install Axis).
I've generated the server side sources from a WSDL using the axistools-maven-plugin, and everything seems to work ok until I have deployed the service. http://localhost:8080/myApp/services gives me the name of the service and two exposed methods. But clicking the wsdl link displays an Axis error message telling me "Could not generate WSDL! There is no SOAP service at this location".
Is it at all possible to build a standalone Axis webservice this way using maven?
Yes, you will need build your application the same way you would for a WAR but programmatically inform tomcat where you exploded war lives.
Everything else should be the same as the standard servlet spec.