dongqieli4164 2019-06-12 12:02
浏览 127

我可以用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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题