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条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器