B4J Question Websockets and SignalR

tufanv

Expert
Licensed User
Longtime User
Hello,

One data feed provider, provides websocket with signalr , I don't have enough info about signalr but it uses a websocket link starting with wss:// , but requesting data from that return error 503. I think signalr implementation is different than than standard websockets , does anyone have enough info about this ? Is there any possibility to use this service in b4j or a signalr library has to be wrapped ?

Thanks
 

MarkusR

Well-Known Member
Licensed User
Longtime User
you missed the authorisation?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
As far as i understand SignalR is an Javascript-Framework using JQuery. It should work on Android Webview i guess (based on their compatibilitychart).
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
As far as i understand SignalR is an Javascript-Framework using JQuery. It should work on Android Webview i guess (based on their compatibilitychart).
Thanks for answer. I am using websockets to get data on realtime so with a simple websocket connection , I am getting pushed data every 1 second under ws_textmessage but I don't understand what i can do with a webview connecting to this socket even if it is possible.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
error 503
503 is service unavailable. Should have nothing to do with your client side programming - at least if the server is returning this as a meaningful status code.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
503 is service unavailable. Should have nothing to do with your client side programming - at least if the server is returning this as a meaningful status code.
yes but people who are using python and signalr lib are not having any issues. I think this error returns when we try to reach to signalr socket without signalr
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
As per Microsoft (https://docs.microsoft.com/en-us/aspnet/signalr/overview/getting-started/introduction-to-signalr)
ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications.
The only relationship to WebSockets is that "SignalR uses the new WebSocket transport where available, and falls back to older transports where necessary." So yeah, just connecting to a SignalR service with a WebSocket is not going to cut it since that only covers the connection to the service.
yes but people who are using python and signalr lib are not having any issues
That's because they are using a library that implements SignalR. It just also happens to support the use of WebSockets as a transport for SignalR.
Is there any possibility to use this service in b4j or a signalr library has to be wrapped ?
Maybe. The java client for SignalR is here (https://github.com/SignalR/java-client). Cannot help you there though, since I'm not a wrapper (pun alert, yes a bad pun, but a pun indeed). Could be that you can use it with JavaObjects.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Thanks for answer. Maybe someone can help with javaobject or wrapping but I know that it is not a simple task so I will have to wait for that :/
As per Microsoft (https://docs.microsoft.com/en-us/aspnet/signalr/overview/getting-started/introduction-to-signalr)

The only relationship to WebSockets is that "SignalR uses the new WebSocket transport where available, and falls back to older transports where necessary." So yeah, just connecting to a SignalR service with a WebSocket is not going to cut it since that only covers the connection to the service.

That's because they are using a library that implements SignalR. It just also happens to support the use of WebSockets as a transport for SignalR.

Maybe. The java client for SignalR is here (https://github.com/SignalR/java-client). Cannot help you there though, since I'm not a wrapper (pun alert, yes a bad pun, but a pun indeed). Could be that you can use it with JavaObjects.
 
Upvote 0
Top