Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
Beaker #1
Member since Mar 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Error trying to publish using MiniClient
I am able to create nodes but when I try to publish to one using the MiniClient the following is the result. This occurs with OpenFire and eJabberd


SEND: <iq id="MX_21" to="pubsub.bobo91b" type="set" xmlns="jabber:client">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <publish node="ejbNodeOne">
      <item>MyPayload</item>
    </publish>
  </pubsub>
</iq>
RECV: <iq from="pubsub.bobo91b" to="admin@bobo91b/MatriX" type="error" id="MX_21" xmlns="jabber:client">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <publish node="ejbNodeOne">
      <item>MyPayload</item>
    </publish>
  </pubsub>
  <error code="400" type="modify">
    <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
    <invalid-payload xmlns="http://jabber.org/protocol/pubsub#errors" />
  </error>
</iq>

Thanks
This post was edited on 2012-01-31, 20:51 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The error message sais invalid payload. I assume the server expects a Xml Payload like described in the PubSub XEP, and not only text. Can you try this?
http://xmpp.org/extensions/xep-0060.html#publisher-publish

Alex
Avatar
Beaker #3
Member since Mar 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
Using the example payload from the xep spec, I get the following

  1. SEND: <iq id="MX_17" to="pubsub.bobo91b" type="set" xmlns="jabber:client">
  2.  <pubsub xmlns="http://jabber.org/protocol/pubsub">
  3.     <publish node="kjhg">
  4.       <item>&lt;entry xmlns='http://www.w3.org/2005/Atom'&gt;&lt;title&gt;the war on terrorism&lt;/title&gt;&lt;summary&gt;WAR&lt;/summary&gt;&lt;link rel='alternate' type='text/html' href='http://homeland.gov/news'/&gt;&lt;id&gt;tag:homeland.gov,1984:entry-32397&lt;/id&gt;&lt;published&gt;1984-12-13T18:30:02Z&lt;/published&gt;&lt;updated&gt;1984-12-13T18:30:02Z&lt;/updated&gt;&lt;/entry&gt;</item>
  5.     </publish>
  6.  </pubsub>
  7. </iq>
  8. RECV: <iq type="error" id="MX_17" from="pubsub.bobo91b" to="user7@bobo91b/MatriX" xmlns="jabber:client">
  9.  <pubsub xmlns="http://jabber.org/protocol/pubsub">
  10.     <publish node="kjhg">
  11.       <item>&lt;entry xmlns='http://www.w3.org/2005/Atom'&gt;&lt;title&gt;the war on terrorism&lt;/title&gt;&lt;summary&gt;WAR&lt;/summary&gt;&lt;link rel='alternate' type='text/html' href='http://homeland.gov/news'/&gt;&lt;id&gt;tag:homeland.gov,1984:entry-32397&lt;/id&gt;&lt;published&gt;1984-12-13T18:30:02Z&lt;/published&gt;&lt;updated&gt;1984-12-13T18:30:02Z&lt;/updated&gt;&lt;/entry&gt;</item>
  12.     </publish>
  13.  </pubsub>
  14.  <error code="400" type="modify">
  15.     <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  16.     <payload-required xmlns="http://jabber.org/protocol/pubsub#errors" />
  17.  </error>
  18. </iq>

Could this have to do with all of the < > that are inside of the <item> tag being translated to &lt and &gt?
This post was edited 2 times, last on 2013-02-26, 20:35 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Beaker:
Could this have to do with all of the < > that are inside of the <item> tag being translated to &lt and &gt?

yes, the XML must not be escaped here.

Alex
This post was edited on 2013-02-26, 20:36 by Alex.
Avatar
Beaker #5
Member since Mar 2010 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: XMLI escape symbols
Since the <> symbols are being replaced with escape sequences after I set the Item.Payload, this sounds like a bug that I cannot work around other than building my iq from scratch. The swap seems to be happening inside of PubSubManager.

Thanks
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can use XmppXElement.LoadXml to build the payload object.

Alex
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: