Problem with adding SoapObject to SoapObject

405 views
Skip to first unread message

Dawid Drozd

unread,
Jan 12, 2012, 3:42:51 PM1/12/12
to ksoap2-android
Hello

I have a litle bit problem with that:

In code:

SoapObject remoteComment = new SoapObject("http://
beans.soap.rpc.jira.atlassian.com",
"RemoteComment");
SoapObject addComment = new SoapObject(connector.getNameSpace(),
"addComment");
addComment.addProperty("token", connector.getToken());
addComment.addProperty("issueKey", issueKey);
// addComment.addProperty("remoteComment", comment);


remoteComment.addProperty("author", comment.getAuthorName());
remoteComment.addProperty("body", comment.getBody());
remoteComment.addProperty("created", "2012-01-06T08:57:36.507Z");
remoteComment.addProperty("groupLevel", null);
remoteComment.addProperty("id", "-1");
remoteComment.addProperty("roleLevel", null);
remoteComment.addProperty("updateAuthor", comment.getAuthorName());
remoteComment.addProperty("updated", "2012-01-06T08:57:36.507Z");

addComment.addSoapObject(remoteComment);

i should get first token then issueKey then remoteComment object but
in envelope i get first remoteComment next token next issueKey. I
must have this in right order my server expects it and i get error
response: org.xml.sax.SAXException: SimpleDeserializer encountered a
child element, which is NOT expected, in something it was trying to
deserialize.

Really thanks!

Andrew Oppenlander

unread,
Jan 12, 2012, 6:32:11 PM1/12/12
to ksoap2-...@googlegroups.com
Currently SoapObjects are treated differently than properties, and are not able to be ordered. SoapObjects are printed first, followed by properties.
For now you will have change your server code.

I will work on a fix for this, since it seems to keep on coming up.
--
Andrew Oppenlander

Dawid Drozd

unread,
Jan 12, 2012, 6:51:41 PM1/12/12
to ksoap2-...@googlegroups.com
Ok then i will try fix it too because i can't edit server code :) and
i must do it quick so i will try. If i do it good i will do pull
request.

Thanks again.

2012/1/13 Andrew Oppenlander <andrew.op...@gmail.com>:

--
Pozdrawiam
Dawid Drozd.

Andrew Oppenlander

unread,
Jan 13, 2012, 1:21:50 AM1/13/12
to ksoap2-...@googlegroups.com
I've completed the patch and sent a pull request. Some more testing should probably be done to ensure that it's all working properly though.
--
Andrew Oppenlander

Manfred Moser

unread,
Jan 13, 2012, 1:05:40 PM1/13/12
to ksoap2-...@googlegroups.com

I will pull this in and cut a new release early next week..

Dawid Drozd

unread,
Jan 13, 2012, 3:59:53 PM1/13/12
to ksoap2-...@googlegroups.com
Sorry but i pull changes from you and they don't work i have exception:

: org.ksoap2.serialization.SoapObject
: java.lang.ClassCastException: org.ksoap2.serialization.SoapObject
: at org.ksoap2.serialization.SoapObject.toString(SoapObject.java:518)
: at java.lang.StringBuilder.append(StringBuilder.java:203)
: at jira.For.Android.Connector.Connector.getResponseFromServer(Connector.java:82)

When i try to do this:

System.out.println("Tak wygląda to co chce wysłac: " + ENVELOPE.bodyOut);

Previously it works.


2012/1/13 Manfred Moser <mos...@gmail.com>:

--
Pozdrawiam
Dawid Drozd.

Andrew Oppenlander

unread,
Jan 13, 2012, 6:02:13 PM1/13/12
to ksoap2-...@googlegroups.com
I probably broke SoapObject.toString. Can you make a test service call and see if the out body is correct?
>>>> >> in envelope i get first remoteComment next  token next --

Andrew Oppenlander

unread,
Jan 13, 2012, 11:50:13 PM1/13/12
to ksoap2-...@googlegroups.com
I was right with my assumption. SoapObject.toString was trying to convert all object in properties to PropertyInfo. It should all be working now. Again here is my github, and here is the jar with dependencies.
--
Andrew Oppenlander

Dawid Drozd

unread,
Jan 14, 2012, 4:23:04 AM1/14/12
to ksoap2-...@googlegroups.com
Yeah it works great work! Thanks a lot.

2012/1/14 Andrew Oppenlander <andrew.op...@gmail.com>:

--
Pozdrawiam
Dawid Drozd.

Manfred Moser

unread,
Jan 16, 2012, 2:34:29 PM1/16/12
to ksoap2-...@googlegroups.com
I am cutting the release right now...
Reply all
Reply to author
Forward
0 new messages