我可以用php / nodejs与SignalR api交谈吗?

so I'm a PHP and NODEJS programmer, I'm trying to talk to an API

the company that provides the API told me they only have c# client and they gave me some c# code and documentation and a link ... I assumed it must be soap or rest API

so I open the link and saw this error

Protocol error: Unknown transport.

so I searched the error and found out its related to SignalR lib, so it must be a SignalR API (I'm guessing ... if that's the right name for it )

I also searched for SignalR in the code they gave me and saw this

namespace OMS.Business.Client
{
    public abstract class SignalRClientProxyBase : IDisposable
    {
        protected HubConnection Connection { get; private set; }
        protected IHubProxy Hub { get; private set; }
        public string ServiceUrl { get; private set; }
        public string HubName { get; private set; }
        private Task _connectionTask;
        public string ServerName { get; private set; }

        public SignalRClientProxyBase(string serverUrl, string hubName, string serverName, bool autoReconnect, Dictionary<string, string> queryString = null)
        {

            ServiceUrl = serverUrl;
            HubName = hubName;
            ServerName = serverName;
            if (queryString != null)
            {
                Connection = new HubConnection(serverUrl, queryString);
            }
            else
            {
                Connection = new HubConnection(serverUrl);
            }
            if (autoReconnect)
            {
                Connection.StateChanged += _connection_StateChanged;
            }
            Hub = Connection.CreateHubProxy(hubName);
            InitHub(Hub);
            StartConnection();
            try
            {
                Connection.Start().Wait();
            }
            catch (Exception ex) { /*Nothing*/}

        }

which seems to be confirming my guess

so my question is is it possible to talk to this API with PHP or should I give up? basically, I'm in the dark, the company doesn't provide any help .... any suggestion or pointers will be appreciated.

douju8782
douju8782 SignalR可以配置为一整套协议,但最常用的是websockets。所以我假设您必须使用websocket客户端连接到端点。
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问