Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
ssteiner #1
Member since Jan 2016 · 26 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: querying active subscriptions on Cisco Finesse - syntax issue
Hi

I'm trying to query a list of active subscriptions from Cisco finesse. But all I get back are error 400.

I was then given a working sample by cisco and I noted there's a difference.

Here's a working request

  1. <iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>
  2. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  3. <subscriptions/>
  4. </pubsub>
  5. </iq>

And here's a non working request that is sent by matrix

  1. <iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>
  2. <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  3. <subscriptions />
  4. </pubsub>
  5. </iq>

Note the #owner attached to the xmln in the pubsub node.

The non working XML gets generated when I call this

  1. Iq data = mgr.RequestSubscriptionsListAsync(pubSubAddress, null).Result;

So, what do I need to do to leave out the #owner so that Finesse can handle the query? (mgr being an Instance of PubSubManager - here's how the whole thing is set up

  1. using (var xmppClient = new XmppClient(login, server, password))
  2.             {
  3.                 xmppClient.OnError += XmppClient_OnError;
  4.                 xmppClient.OnMessage += XmppClient_OnMessage;
  5.                 xmppClient.OnBind += XmppClient_OnBind;
  6.                 xmppClient.Open();
  7.                 mgr = new PubSubManager(xmppClient);
  8. ....
  9. })
This post was edited 2 times, last on 2016-02-29, 12:40 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There is:

RequestSubscriptions and RequestSubscriptionsList in MatriX.

You should use RequestSubscriptions.

see also:

Alex
Avatar
ssteiner #3
Member since Jan 2016 · 26 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
It works using RequestSubscriptions (or the async variety)... RequestSubscriptionsList adds the #owner and that apparently is not supported by Finesse.
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
those are 2 totally different queries described in the links above.
One is for owners, the other for users,

Alex
Avatar
ssteiner #5
Member since Jan 2016 · 26 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
Hmm... so I take it then that the node owner would be somebody else, maybe a system admin user.

Either way, I now have my subscription list. And I even found the way to turn the subscriptions into code - perhaps this can be of use to somebody else so here goes:

  1. var pubSub = data.Element<Matrix.Xmpp.PubSub.PubSub>();
  2. foreach (var sub in pubSub.Subscriptions.Elements<Matrix.Xmpp.PubSub.Subscription>())
  3. {
  4.     //do something with the subscription.. it contains jid, node, status..
  5. }
This post was edited on 2016-02-29, 16:45 by Alex.
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by ssteiner:
Hmm... so I take it then that the node owner would be somebody else, maybe a system admin user.

correct

but if you look under teh link above you see that the admin query also requires to specify the node name (node='princely_musings')

  1. <iq type='get'
  2.     from='hamlet@denmark.lit/elsinore'
  3.     to='pubsub.shakespeare.lit'
  4.     id='subman1'>
  5.  <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
  6.     <subscriptions node='princely_musings'/>
  7.  </pubsub>
  8. </iq>

Alex
Avatar
ssteiner #7
Member since Jan 2016 · 26 posts · Location: Switzerland
Group memberships: Members
Show profile · Link to this post
weirdly enough it works when I use node = null.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS