3

setCookie(string, string)CometD .NET 在调用方法时抛出异常,BayeuxClient因为我没有为这些 cookie 设置域,但我没有看到设置域的属性或方法,并且没有任何重载setCookie(...)将域作为范围。

代码:

this._bayeuxClient = new BayeuxClient(
                "https://***.salesforce.com/cometd/24.0", //instance omitted
                new List<ClientTransport> { new LongPollingTransport(null) });

this._bayeuxClient.setCookie("com.salesforce.LocaleInfo", "us");
//...

this._bayeuxClient.handshake(); //Exception is thrown here.
this._bayeuxClient.waitFor(1000, 
    new List<BayeuxClient.State> { BayeuxClient.State.CONNECTED });
4

0 回答 0