Monday, August 18, 2008

Exposing OSGi service as a Web service using Apache Axis2

As part of Axis2/OSGi integration process, we have implemented the basic facility to expose an OSGi service as a Web service. Still some of the advanced functionalities related to this function is in development stage and we will update the progress as we go alone.

In order to facilitate this, register OSGi service with Directory object with name/value pair " of WS". This will create an AxisService with default Axis2 properties. This includes message receivers to be RPC*, default schema/targetNamespace generation etc.

You can test this out from here. Follow "axis2_osgi_integration.pdf" to set up the environment.

The example has registered a simple Calculator POJO as an OSGi service and exposed it as a WS. The name/value pair for this instance is "". Then one will be able to observe

wsdl -> http://localhost:8080/services/myCal?wsdl
wsdl2 -> http://localhost:8080/services/myCal?wsdl2
A request -> http://localhost:8080/services/myCal/add?x=10&y=10


Fatal said...

hi saminda,
i followed your instructions, but i miss the javax.servlet package. all other packages were generated without any problem, but javax.servlet isn't there and the pom.xml entry for it is missing, too.

Santiago Miguel Aranda Rojas said...

I am following your axis2_osgi_integration.pdf but I have had some doubts or problems. I have twenty eight bundles running correctly. But the last one "29 org.apache.axis2.osgi_1.0.0.SNAPSHOT" is not working because the import javax.jms can not be found or resolved. Do I need more bundles? What bundle have to export this package?
Thanks in advance

Rajesh Girish said...

Hi Saminda,

I followed your document in the Apache SVN ,I'm getting into problem finally after long hours of resolving bundles and packages.I tried adapting to the document thrice freshly but there is no success.. .I alway stuck into this problem or error which i could not solve.I request you to please please shed some light on this .. so that i can i get out of this problem ....

Rajesh Girish said...

Here is my Stacktrace... Please give me some solution or i will go mad as this is very urgent

org.osgi.framework.BundleException: Exception in org.apache.axis2.osgi.internal.Activator.start() of bundle org.apache.axis2.osgi.
Nested Exception:
at java.lang.ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(
at java.lang.ClassLoader.loadClass(Unknown Source)

Rajesh Girish said...

Hi Saminda

Axiom Bundles are not properly packaged so i'm facing problems.

Can you give me stable build Bundles of axiom which i can install...