Hi,

My comment inline
On 2010-12-15, at 下午7:26, Markus wrote:


Hi Freeman, hi David ,

yes, I try to use the http-osgi transport. The bundle is deployed:
32      ACTIVE      cxf-rt-transports-http-osgi_2.2.9

But I am not using servicemix at all. Maby I am wrong, but I thought that using an Enterprise Service Bus is not necessary. I will have some business logic which I would like to modularize based on OSGi. This software must be usable from a remote web portal. Therefore, I would like to build the web service frontend from a given WSDL with CXF. I thought that a simple OSGi container is sufficient for this purpose, so I am using Eclipse Equinox 3.6 at the moment (but maby I am wrong with this, so I am open for suggestions).
Just a quick note.
Servicemix provide lots of pre-installed bundle/features which is very convenient for you to use cxf/camel/activemq/JBI inside OSGi container. And Servicemix team make great effort to verify those bundles can work together, this can save you a big time as you needn't do it from scratch.

I set the org.osgi.service.http.port to 8080, whichis also given in the WSDL
and as far as I know the default for OSGi.
I tried to access the webservice with
http://localhost:8080/cxf/CustomerServicePort?wsdl and
you should use  http://localhost:8080/cxf/CustomerServicePort?wsdl
this url is the way for cxf http-osgi transport works
http://localhost:8080/CustomerServicePort?wsdl. But the port 8080 and is not opend. According to a port scan with NMap, there is no open port and no web
service available (search was not limited to 8080).

Port 8080 isn't up means the undlerly OSGi http service isn't up, OSGi http service is OSGi core service per OSGi spec, there're several OSGi http service implementations available, pax-web is the one we generally use.
You need install several bundles to start OSGi http service

org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2
org.apache.servicemix.bundles/org.apache.servicemix.bundles.jetty- bundle/6.1.22_1
org.ops4j.pax.web/pax-web-api/0.7.3
org.ops4j.pax.web/pax-web-spi/0.7.3
org.ops4j.pax.web/pax-web-runtime/0.7.3
org.ops4j.pax.web/pax-web-jetty/0.7.3
In servicemix you can use "features:install http" to install all of those bundle, actually it's default feature for servicemix, so by default there's a OSGi http service up for you to use :-) .

com.example.customerservice.osgi.Activator simple publishes the service:
 Object implementor = new CustomerServiceImpl();
 String address = "http://localhost:8080/CustomerServicePort";;
 Endpoint.publish(address, implementor);
CustomerServiceImpl is the implementation generated by CXF with some simple
code added for testing.

Ok, this Activator class actually publish cxf service over http transport, but not the http-osgi transport, that's why it success without OSGi http service up.

Hope all this helps.

Freeman
The spring-dm demo from CXF-DOSGi is not exactly what I am trying to do (or at least I think so). I build a web service from a given WSDL with CXF. And now I would like to run this web service (not OSGi service) within OSGi. I have not investigated whether CXF-DOSGi is an alternative for my purpose,
but I will give it a try.

Best Regards,
Markus
--
View this message in context: 
http://cxf.547215.n5.nabble.com/Web-Service-in-OSGi-with-spring-dm-tp3306001p3306115.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org

Reply via email to