If you encounter the same issue, try making the following modification to the StartOrRecoverSessionResponse
to resolve the problem:
[Serializable]
public class StartOrRecoverSessionResponse
{
[Newtonsoft.Json.JsonProperty("newConnectionHandle")]
public string NewConnectionHandle { get; set; }
[Newtonsoft.Json.JsonProperty("recoveredTopics")]
public string[] RecoveredTopics { get; set; }
[Newtonsoft.Json.JsonProperty("status")]
public string Status { get; set; }
[Newtonsoft.Json.JsonProperty("traceId")]
public string TraceId { get; set; }
public StartOrRecoverSessionResponse(string newConnectionHandle, string[] recoveredTopics, string status, string traceId)
{
this.NewConnectionHandle = newConnectionHandle;
this.RecoveredTopics = recoveredTopics;
this.Status = status;
this.TraceId = traceId;
}
}
// Initialize the SignalR connection
connection = new HubConnectionBuilder()
.WithUrl("https://xxxxx.playfabapi.com/PubSub", options => { options.Headers.Add("X-EntityToken", entityToken); })
.WithAutomaticReconnect()
.Build();
// Start the SignalR connection
await connection.StartAsync();
var response = await connection.InvokeAsync<StartOrRecoverSessionResponse>("StartOrRecoverSession", new StartOrRecoverSessionRequest { traceParent = "00-84678fd69ae13e41fce1333289bcf482-22d157fb94ea4827-01" });