Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Parser is not converting all of the XML to JSON #114

Open
MrScorp opened this issue Feb 16, 2019 · 2 comments
Open

Android: Parser is not converting all of the XML to JSON #114

MrScorp opened this issue Feb 16, 2019 · 2 comments

Comments

@MrScorp
Copy link

MrScorp commented Feb 16, 2019

Android:
As a response to a user search stanza, the server is returning multiple fields for the result items, but the parser is returning only the "Name" field after converting it to JSON in rnxmpp.utils.Parser. To verify, I trapped a log from the "processPacket" method in XmppServiceSmackImpl and obtained the actual XML response which is returned by the server.

Example:
Actual XML returned by the server as a response to "sendStanza" :

johnson.m.kal@xxxx.com johnson@xxxxxx.com johnson Johnson

JSON returned in the javascript onIQ() callback :

{
"query": {
"x": {
"field": {
"type": "hidden",
"var": "FORM_TYPE"
},
"item": {
"field": {
"value": "Johnson",
"var": "Name"
}
},
"reported": {
"field": {
"type": "text-single",
"var": "Email",
"label": "Email"
}
},
"type": "result",
"xmlns": "jabber:x:data"
},
"xmlns": "jabber:iq:search"
},
"type": "result",
"id": "HyT457",
"from": "search.xxxxxx.com",
"to": "xxxx@xxxx"
}

Am I missing something? Any configuration is needed for sending stanzas?

Thank you.

@MrScorp MrScorp changed the title Parser is not converting all of the XML to JSON Android: Parser is not converting all of the XML to JSON Feb 16, 2019
@MrScorp
Copy link
Author

MrScorp commented Feb 17, 2019

WritableMap.hasKey method is always returning false. Have submitted a PR for the fix.

@penna-superlogica
Copy link

Hi @MrScorp it seems that the problem is not at the parse, but in the data sent to it wich only contain the "message" tag, right?

Did you be able to solve this? We are struggling with this same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants