Hi,

You can also take a look at this implementation [0].
We manually register a web socket servlet in the OSGi service [1] [2].

It is a little more complicated that just an example.
The reason is that we need to inject iPojo components in our web sockets.
But anyway, it may help. BTW, it works with Karaf 4 (since we need a recent version of Jetty).

Regards,

                 Vincent.



[ 0 ] : https://github.com/roboconf/roboconf-platform/tree/master/core/roboconf-dm-rest-services [ 1 ] : https://github.com/roboconf/roboconf-platform/tree/master/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/websocket [ 2 ] : https://github.com/roboconf/roboconf-platform/blob/master/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/ServletRegistrationComponent.java


Le 04/04/2016 21:40, Nick Baker a écrit :
Hey All,

Does anyone have a working project using WebSockets? I was trying a quick prototype repurposing the CXF example but haven't had any luck:

https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/websocket/src/main/java/demo/jaxrs/server/CustomerService.java


I keep receiving a 200 from the server, whereas 101 should be returned:

[Error] WebSocket connection to 'ws://localhost:8181/cxf/sockets/infinitymachine/clock' failed: Unexpected response code: 200

Thanks,
Nick

--
Vincent Zurczak
Linagora: www.linagora.com <http://www.linagora.com/>

Twitter <https://twitter.com/VincentZurczak> Vincent Zurczak @ LinkedIn <http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> My Skype ID <callto://vincent.zurczak> My English blog <http://vzurczak.wordpress.com>

Reply via email to