Thanks All!

Turned out I was missing the 
transportId="http://cxf.apache.org/transports/websocket"; attribute on the 
<jaxrs:server> tag. I'm now getting a WebSocket created on the client and it is 
receiving events from the server. Unfortunately, the messages are all "\r\nX".

This is encouraging though. I'll keep going and keep you all posted.

-Nick

From: Aki Yoshida <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, April 5, 2016 at 5:11 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: Working WebSocket example?

Hi,
I have just added an osgi (blueprint) version of that cxf websocket sample to 
cxf's sample distribution. It should work on both karat 3.0.x and 4.0.x out of 
the box.
https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/websocket_osgi

There is also a node.js client included in this sample to test this cxf service 
using websocket and SSE.




2016-04-04 21:40 GMT+02:00 Nick Baker 
<[email protected]<mailto:[email protected]>>:
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

Reply via email to