Hi All,

I am a newbie but was able to create a basic jax-rs web service and a
simple chat application based on web sockets.

My requirement is to create a curl client through which I can push data to
a browser which has web sockets enabled (the simple chat application [1]
implemented with a curl client). I am finding it hard to understand how to
build the connection between the jax-rs web service and the web socket
implementation.

I have attached a diagram of the communication process between the jax-rs
web service and the browser based on my understanding about the domain.
Initially I make a rest call through the curl client and send a message to
the jax-rs web service which loads the html file containing the js file to
connect to the web socket end point. The jax-rs web service and web sockets
server both are deployed in the same web app in the AS>

So far I have created a jax-rs web service which returns an html file as
response to the rest call. The code is specified below.











*@Path("/hello")public class HelloService
{ @GET @Produces({MediaType.TEXT_HTML}) @Path("/{message}") public
InputStream sayHello(@PathParam("message") String name) throws
FileNotFoundException {  File file = new File(HTML_FILE_PATH);  return new
FileInputStream(file); }}*

But I am unable to pass the parameter (message) to the html file using by
the above method.

Could anyone give me any insight on $subject and also clarify my approach
taken.

Thanks.

[1] https://blog.idrsolutions.com/2013/12/websockets-an-introduction/

-- 
Sabra Ossen <http://lk.linkedin.com/in/sabraossen>
Undergraduate | Department of Computer Science and Engineering
University of Moratuwa
Sri Lanka
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to