Ayrı bir soru sormadan önce bu konu hakkında pek çok şey yaptım ve halihazırda mevcut olan question stackoverflow dosyasına bir yorum ekledim.SignalR Sunucu Hatası "ConnectionId yanlış biçimdedir." SignalR-ObjC Library ile
Bir SignalR Hub aşağıdaki kodu ile benim sunucuda (. Her iki v 1.1.3 ve 2.0.0-rc çalıştı) var: Ben Yetki özelliğini kaldırırsanız
[HubName("TestHub")]
public class TestHub : Hub
{
[Authorize]
public void TestMethod(string test)
{
//some stuff here
Clients.Caller.NotifyOnTestCompleted();
}
}
Sorun devam.
Ve iOS istemci
aşağıda koduyla diyoruz deneyin:SRHubConnection *hubConnection = [SRHubConnection connectionWithURL:_baseURL];
SRHubProxy *hubProxy = [hubConnection createHubProxy:@"TestHub"];
[hubProxy on:@"NotifyOnTestCompleted" perform:self selector:@selector(stopConnection)];
hubConnection.started = ^{
[hubProxy invoke:@"TestMethod" withArgs:@[@"test"]];
};
//received, error handling
[hubConnection start];
uygulama kullanıcısı giriş yapmadığında başladığında ve hiçbir açık SignalR bağlantı yoktur. Kullanıcılar, sunucuda WebSecurity.Login
yöntemini kullanan bir Giriş hizmetini çağırarak oturum açar. Oturum açma hizmeti başarıyı döndürürse, yukarıdaki çağrıyı SignalR Hub'a yapın ve "ConnectionId yanlış biçimdeydi" açıklamasını içeren sunucu hatası 500'ü aldım.
Exception information:
Exception type: InvalidOperationException
Exception message: The ConnectionId is in the incorrect format.
at Microsoft.AspNet.SignalR.PersistentConnection.GetConnectionId(HostContext context, String connectionToken)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://myserverip/signalr/signalr/connect?transport=webSockets&connectionToken=axJs EQMZxpmUopL36owSUkdhNs85E0fyB2XvV5R5znZfXYI/CiPbTRQ3kASc3 mq60cLkZU7coYo1P fbC0U1LR2rI6WIvCNIMOmv/mHut/Unt9mX3XFkQb053DmWgCan5zHA==&connectionData=[{"Name":"testhub"}]
Request path: /signalr/signalr/connect
User host address:
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DefaultAppPool
Thread information:
Thread ID: 14
Thread account name: IIS APPPOOL\DefaultAppPool
Is impersonating: True
Stack trace: at Microsoft.AspNet.SignalR.PersistentConnection.GetConnectionId(HostContext context, String connectionToken)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Bu uyuşmayan kimlik doğrulama ve kullanıcı kimliğinin bir tür ama şimdi çözmeye hiçbir şekilde yukarı bulduk anlamak:
tam sunucu StackTrace
şudur. Diğer tüm sorular, kullanıcı kimliği değiştiğinde açık bağlantıyı durdurmayı önerir ama yukarıda belirttiğim gibi, kullanıcı başarıyla oturum açmadan önce açık bir bağlantım yok.Herhangi bir yardım çok takdir edilecektir. Teşekkür ederiz.
Bunun için bir çözüm buldunuz mu? Bendede aynı sorun var. – tremolo
Bu hatayı yaklaşık 5 defa 4 üzerinden alıyorum.Bu nedenle, bazen sunucu sunucuda connectionId hatası üretmez, ancak çoğu zaman bunu yapar. Yine de herhangi bir kimlik doğrulama işlemim yok. – tremolo
@tremolo: Üzgünüm, henüz bir çözüm yok. – ozzotto