why 'xml-not-well-formed'? - xmpp

using sasl plain in xmpp
from server (sasl negotiation)
<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='TQ2JFyRoSa70h2G1bpgjzuXb2sU='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
sent from client
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGlnZW55YXIAMTIzNDU2Nzg=</auth>
where the crappy thing in between is base64-encoded of "\0login\0password"
respond from server
<stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
Any reason? Thanks.

The First entry has an extra Closing "mechanisms" tag after the SCRAM-SHA-1 Item.

As others have pointed out: The XML looks well formated. I guess you need to rethink your problem. It's not "Why is the XML not well formated", but "Why does the server reply with xml-not-well-formated when it sees this stanza?"
And in order to answer this question you (nobody else can do it for you) should debug the server implementation and find out what's causing it.

Related

how could I delete archived messages partially or completely from ejabberd server 16.06

how could I delete archived messages partially or completely from ejabberd server 16.06 (I am using conversejs as ejaberd client).
To remove a single collection. You need to send a request to the ejabberd server in below format.
<iq type='set' id='remove1'>
<remove xmlns='urn:xmpp:archive'
with='juliet#capulet.com/chamber'
start='1469-07-21T02:56:15Z'/>
</iq>
with: The 'with' attribute MAY specify JID of XMPP entities
start: 'start' and 'end' elements MAY be specified to indicate a date range
Yes there might be an end attribute. You can read all about in details here. Perhaps you might have to implement the api by yourself at client side.
Disclaimer: I haven't worked with converse.js

Can I ignore message/delivery-status in mail client?

How I did understand, message/delivery-status is a mime type of message part,
which contains the data formatted for the mail server to read (Wiki)
Does it mean that I can ignore it while receiving message from mail server? If not, could you give more explanation of present mime type.
How should I parse it and do I need to present it to user?
I found it on official specifications https://www.rfc-editor.org/rfc/rfc3464#section-2.1

Facebook Chat (XMPP) XEP 0080 support

I have being checking out using a prototype test program the capabilities of the XMPP Facebook Chat, X-FACEBOOK. It worked great using a geoloc message XEP 0080 with Gmail servers, but when i try to send the same XML structure through the X-FACEBOOK, it trims the message and removes the GeoLoc node.
I wanted to ask if someone knows if its possible to send XEP 0080 messages in X-FACEBOOK and if so what structure should I use so the Facebook Chat XMPP Server won't trim the GeoLoc info.
Sent XMPP geoloc message:
<message to="-100002578491827#chat.facebook.com" from="4yony4#chat.facebook.com/19256ca9_4C5CC12947646" type="chat" xml:lang="en">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="http://jabber.org/protocol/geoloc">
<item id="">
<geoloc xmlns="http://jabber.org/protocol/geoloc">
<lat>40.488137</lat>
<lon>-3.397623</lon>
<timestamp>2012-07-27 09:09:50 GMT</timestamp>
<msgType>0</msgType>
</geoloc>
</item>
</items>
</event>
<body>
</body>
Received message by client:
<message xmlns="jabber:client" from="-1177157556#chat.facebook.com" to="" type="chat">
<active xmlns="http://jabber.org/protocol/chatstates"/>
<body></body>
</message>
Any solution or opinion will be greatly appreciated.
Well, changed the XML to resemble the one you posted, without the pub sub, and still the same problem, the message received in the recipient lacks all the namespaces under the GeoLoc node, which I think is a result of the Server not supporting that format. I can try and use the IQ subscriber option, thing is that I prefer to find a solution on which I can directly send the info to a user.
If there is a possibility, even a small one in which i may be able to send information regarding GeoLoc from User A to User B in Facebook Server it may be of great help, if not well i guess i will have to accept it.
Thx for the help BTW.
When I was testing facebook XMPP connection, it did not support almost any extensions and blocked any custom tags on server. It was able to send basic presences, basic messages, vcards and that was about all it could do.
Pubsub events should be sent to services. Modern XMPP servers also support PEP extension and you can send pubsub to servers itself. In other cases, use message with target user as Robin have advised.
I do not think facebook has any server with pubsub. Also i think it still filters any unsupported namespaces. Feel free to prove me I am wrong, it is more than year since I last tested it.
These are not the same message.
The received message is simply an indicator of the users chat state, as defined in XEP-0085 and has no direct relationship to the message you sent. That doesn't mean that the first didn't potentially trigger the second, whatever library you are using may have sent the chatstate as well when you sent the message. This type of message is commonly used in chat clients to indicate that someone you are chatting with is typing a message.
The problem is probably that the message you are sending is in fact a PEP message. This is meant to be sent by the PEP service in the server, not from a client. I don't know if Facebook supports PEP or not, but I would guess that it is being filtered out due to your incorrect usage of a known namespace. PEP or Pubsub are the recommended ways of publishing geolocation information, but to utilize those you have to send an IQ packet to the service, not a message to the other client.
Try this instead (Not saying it will work, but at least the pubsub stuff is stripped):
<message to="-100002578491827#chat.facebook.com" from="4yony4#chat.facebook.com/19256ca9_4C5CC12947646" type="chat" xml:lang="en">
<geoloc xmlns="http://jabber.org/protocol/geoloc">
<lat>40.488137</lat>
<lon>-3.397623</lon>
<timestamp>2012-07-27 09:09:50 GMT</timestamp>
<msgType>0</msgType>
</geoloc>
<body>
</body>
</message>
I want to second Pihhan. It seems like the Facebook XMPP servers restructure messages to contain only the message body, date, and timestamp. I think they do that to keep it identical to their comment graph objects.
It is annoying, but I suspect it is deliberate. After all, their Graph is the main issue, not XMPP.

Handle see-other-host in smack

I'm trying to use smack in order to connect to Microsoft's Xmpp Msn api. Last april they made a change in their implementation which forces clients to implement the "see-other-host" xmpp specification. When I try to connect to "xmpp.messenger.live.com" I get
stream:error (see-other-host)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:260)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
I'm debugging and I can see the raw received packets
<stream:stream from="messenger.live.com" version="1.0" id="59784" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
<stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
<stream:stream from="messenger.live.com" version="1.0" id="59785" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
<stream:error xmlns:stream="http://etherx.jabber.org/streams"><see-other-host xmlns="urn:ietf:params:xml:ns:xmpp-streams">BY2MSG3020517.gateway.edge.messenge r.live.com</see-other-host></stream:error>
But I'm unable to find a way in order to intercept and handle that redirect.
Has anybody done this? Any help would be appreciated. Thanks.
BTW I've already post this on smack forums but got no reply, hope this is isn't considered cross-posting.
This background may help in fixing the problem
The see-other-host stream error redirects a client to another server. In the case of Messenger, it's intended to allow clients to cleanly switch to another server should their current server go out of service, or to connect to another server for load-balancing purposes.
Based on Sample Java Codes that uses SAMCK there are two problems:
The registered connection listeners don't receive notification of the exception
there's no way to access the text element of a stream error from XMPPException
Handling the redirection internally would be the friendliest solution, but notifying the client of the new server would at least allow clients to make a new connection without user intervention.
I added see-other-host support to SMACK API for try. Now i can get see-other-host address as an Exception. For Example when i try to connect to messenger.live.com address i'm successfully getting see-other-host : BAYMSG1020118.gateway.messenger.live.com .
Then i try to connect BAYMSG1020118.gateway.messenger.live.com , i'm getting see-other-host again with different address: BY2MSG4010610.gateway.messenger.live.com
Finally when i try to connect BY2MSG4010610.gateway.messenger.live.com , i'm getting this exception :
No response from the server.:
java.lang.NullPointerException
at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:73)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:211)
at org.jivesoftware.smack.Connection.login(Connection.java:348)
at com.ms.wlm.XmppClient.logIn(XmppClient.java:161)
at com.ms.wlm.Program.main(Program.java:62)
I'll share this result with Smack guys also. If you want, I can send to you the capture of our xmpp traffic via email.
Best Regards,
Alper Ozdamar
I finally found a solution for this issue by changing hostname from messenger.live.com to 64.4.61.217 in ConnectionConfiguration constructor as shown in the code below:
I got this IP by executing (nslookup messenger.live.com) in Dos Command Prompt then I got an Address which I have used in the ConnectionConfiguration.
SASLAuthentication.registerSASLMechanism("X-MESSENGER-OAUTH2",
XMessengerOAuth2.class);
SASLAuthentication.supportSASLMechanism("X-MESSENGER-OAUTH2");
ConnectionConfiguration config = new ConnectionConfiguration("64.4.61.217", 5222, "messenger.live.com");
config.setRosterLoadedAtLogin(true);
config.setSASLAuthenticationEnabled(true);
connection = new XMPPConnection(config);
connection.connect();
connection.login(username, password);
Hope this would help,,,

Authentication Error in username and password

Ha ii everybody ,i am doing a reader application in iphone ,my need is to sync text to google-doc and download it when even wanted,i finished it,but my problem is when i put the username and password to google-doc for authentication it shows an error message GData error Service Forbiddon…."403.4 SSL required"(403),whats the meaning of this message?how can i solve this,if anybody knows how to solve this issue please help me as soon as possible.
Thanks in advance.
Without knowing how you exactly send the request the message indicates that you have to use SSL and thus https to access the service instead of http. Depending on how you query the service this may be as simple as changing the URL or quite complicated.
I have solved my problem .we have to put https instead of http for the url.simple.Need to put (s) in http.every thing works fine for me now.
Thanks .