Refreshing a subscription / checking if a subscription is still valid

Post Reply
ssteiner
Member
Posts: 61
Joined: 05 Feb 2009 09:20

Refreshing a subscription / checking if a subscription is still valid

Post by ssteiner »

I'm working on ensuring that my application can handle any kind of session/subscription/chunked channel loss.
The scenario I'm looking at right now is of a timed out subscription that I'm not made aware of (I'm thinking of firewalls that mess with the chunked channel if there's no traffic for a certain amount of time). In that case, you'd not note that the chunked channel is no longer functional.. at some point, the O2G would cut the connection though - so invalid subscription, but the session is still there.

Is there a way to talk to the /subscription endpoint to verify that the id is still valid? e.g. a PUT without any filter?

And, as part of my tests I also terminated the subscription (DELETE on /subscriptions/{subscriptionId}). That terminates the chunked channel. If I try to re-establish the chunked channel, I get an HTTP 400 in the usual error format, and an innerMessage tag containing this XML

<?xml version="1.0" encoding="UTF-8" ?>
<OTEvents>
<message text="ERROR: Provided subscriptionId not valid">

</message></OTEvents>

Is that documented somewhere (the format of that data so that I can build code to properly handle what may come back here). It's kinda weird to get XML back from a service that otherwise speaks JSON with me.
Post Reply

Return to “O2G”