[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ksoap: BUG?: Soap service method has multiple parameters


I have a problem when more than one parameter is declared in my SOAP
service method.

The called method is:

    public String getNextSystemAlert( Boolean returnTimeWithAlert,
String testString )


I get varying results according to how I publish the methods in the
class.
If I publish using:

	publishClass( alertService.getClass(),"urn:system-alert");

....it dosen't publish the parameter names (which are
returnTimeWithAlert and testString) nor the namespaces, although I
wouldn't expect it to capture namespaces.  This only time this works for
me is when I have one parameter in the calling method.

If I use publishMethod(...), and specify the parameter names in the
PropertyInfo, then I can get this to work if I modify the following code
in SoapSerializationEnvelope, under readSerializable(...):

                //modification:
                if (info.name == null
                    ? testIndex == sourceIndex
                    : (info != null && (info.name.equals(name) ||
info.namespace.equals(parser.getNamespace()))))
                    break;
                
		    //original:
                //if (info.name == null
                //        ? testIndex == sourceIndex
                //        : (info.name.equals(name) && info == null ||
info.namespace.equals(parser.getNamespace())))
                //        break; 

This will break (and populate a SoapObject) if there is a match between
the current SOAP envelope element and the method parameters.  The match
can be either on the parameter name, or the namespace, but maybe it
should be both?  However, most publishMethod(..) possibilities don't
capture the namespace.

Finally, if I don't use publishMethod(...) at all, then this all works
with multiple parameters without requiring any code changes.  It takes a
different route in the code which dosen't touch on the above sniplet at
all.

Any help much appreciated,
Mike