Problems with KSoap2

"Randy Fish" <[email protected]> Wed, 27 Nov 2002 16:48:24 -0800
Newsgroups gmane.comp.java.enhydra.ksoap
Message-ID <[email protected]>
I just downloaded an tried out the new KSoap2 that was release on the 20th
of Nov. 2002.

It seems as if there are a few problems:

1.) Currently, SoapFault objects are not being handled in the SoapServlet
properly.  What I mean by that is that they are caught and even set in the
Envelope, but when it comes time to serialize them out to the response, the
writeObject does not know what to do with them and hence, throws some sort
of Exception.

2.) As of right now, the dotNet flag in the envelope does nothing.  It is
used to assign some sort of namespace variable, but that variable is never
used.  We use a development tool called IntelliJ and the latest version of
the IDE show all unaccessed local varaibles.  ;)

3.) I am using this to do some of UPnP and in UPnP there are some rules
about namespaces and such that I had to work around.  It seems like they
require (or at lease recommend) the envelope namespace to have a prefix of
"s".  I could not find a way to set the prefixes of such things.

4.) In the readSerializable method of SoapSerializationEnvelope, there is a
snippet that checks to see if the namespaces and such match...well it is
possible for the info.namespace to be null and in this case, we get a
NullPointerException.  Maybe that is what the dotNet flag is for (the
comments in the code led me to believe that) but in any case, I changed it
to the following, and it seemed to work:

	if (info.name == null
      	? testIndex == sourceIndex
            : (info.name.equals(name)
			&& info == null 			// <----- 	seems pointless since we would have gotten
a
								// 		null pointer at the info.name
			|| (info.namespace == null
				|| info.namespace.equals(parser.getNamespace())
			)
		)
	)
                    break;

In order to work around these problems, I had to subclass
SoapSerializationEnvelope and rewrite a few of the methods.  All in all,
things look pretty good, but I wanted to make you aware of the problems I
found.  Let me know if and when they get fixed so I can download a new
binary and source, etc.

Randy Fish
Software Engineer
SimpleDevices, Inc.
http://www.simpledevices.com