Web-socket version

1 Which version of web socket does Ignition support JSR or Jetty?
2. What are the maven dependencies for this version in Ignition sdk?
3. Where is the link to the Ignition java class library documentation on line?
4. from which version of Ignition onwards is this supported? (I guess 7.7 onwards)?

Any inputs from Colby?

I have put the following dependencies in maven

   <dependency>
       <groupId>org.eclipse.jetty.websocket</groupId>
       <artifactId>javax-websocket-server-impl</artifactId>
       <version>9.4.12.RC1</version>
   </dependency>

But the errors don’t disappear!
I even included Ignition matro-jars and catapult dependencies from Ignition, however the errore don’t go away.

help will be appreciated.

What errors? What are you trying to do?

while trying to import with “import.javax.websocket.*” in my code, I get error “package websocket doesnot exist”, even including individual classes gives same error. I am trying to establish communication with NJSCADA.

We don’t export any of the WebSocket APIs in a way that you can see them as a module author.

The latest version of 7.9 uses Jetty 9.3.8. You might be able to add these dependencies, using provided scope to indicate they’re already going to be on the class path and don’t need to be packaged in your module:

<dependency>
  <groupId>org.eclipse.jetty.websocket</groupId>
  <artifactId>websocket-server</artifactId>
  <version>9.3.8.v20160314</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.eclipse.jetty.websocket</groupId>
  <artifactId>websocket-servlet</artifactId>
  <version>9.3.8.v20160314</version>
  <scope>provided</scope>
</dependency>

The javax.websocket.* import isn’t going to work because we don’t include or use the JSR 356 WebSocket API.

These dependencies are only for creating server-side WebSockets. You’re on your own if you need client ones.

why its included twice? They are the same

.[quote="Kevin.Herron, post:5, topic:19215"]
The javax.websocket.* import isn't going to work because we don't include or use the JSR 356 WebSocket API.
[/quote]

I tried individually

import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

But still error, which library should I import?

I am trying only server side functionality in my module.[quote="Kevin.Herron, post:5, topic:19215"]
We don't export any of the WebSocket APIs in a way that you can see them as a module author.
[/quote]

got it.

Though I have installed 7.9 version on my development system, but will it not work on older version like 7.7 & 7.8 of Ignition? I guess it was introduced in version 7.7 as presented in 2015 ICC presentation by Colby if I remember.

I updated the dependencies so they aren’t the same.

None of the javax imports will work because they aren’t on the classpath. You can add them yourself and see if they work.

The Jetty websocket jars should be included as far back as 7.7, though I don’t know what version it would be.

Oh I didn’t notice the difference!. Sorry about that.
Thanks a lot, I will try to include them in the classpath.
I will change the Ignition version number in dependencies to 7.7 or 7.8 and try.

Thanks a lot kevin, you are always very helpful.

b/r

  • Which version do you recommend JSR or JETTY?
  • What are the maven dependencies for JSR version?
  • Which version does Ignition use?
  • I would prefer JSR version as its more industry standard.

Which version do you recommend JSR or JETTY?

Jetty because it's already included.

What are the maven dependencies for JSR version?

Don't know, google it?

Which version does Ignition use?

Jetty

I would prefer JSR version as its more industry standard.

Find and add the Jetty/JSR API artifact then.

Thanks a lot Kevin. Let me first start with Jetty as its readily available in In jetty. Hope fully it will be compatible with industry standard as I want to communicate with NJSCADA!

Hi Kevin,

I created jetty ws server in my module, while accessing it from from a browser on 8088 (ignition) port, I get following error:

webSocket connection to ‘ws://localhost:8088/test’ failed: Error during WebSocket handshake: Unexpected response code: 302

With 8080 portI get different error:

WebSocket connection to ‘ws://localhost:8080/test’ failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Should the jetty server (Ignition gateway server) be restarted after installing my module for the servlet to get registered? I tried that but doesn’t help.

I tried even the JSR365 version , but on port 8088 it gives the same error:

failed: Error during WebSocket handshake: Unexpected response code: 302

Will the ws client work only under an Ignition client session? Otherwise how does it get the http session for handshake to convert to ws client? I should also be able to access the ws server from a non browser client as well. How does ignition EAM module work?