android - Error when connecting kSoap to Spyne The attribute '{http://schemas.xmlsoap.org/soap/encoding/}root' is not allowed -
i have soap server written in python using spyne. have created soap client in python using suds. works perfect. here code server
class personnel(servicebase): @rpc(_returns=string) def personnel(self): """docstrings service methods appear documentation in wsdl. <b>what fun!</b> @param name name hello @param times number of times hello @return completed array """ employees_list = employees() employees_list.populate_from_db("elleo", "odoo", "0801", "127.0.0.1") tststring = "dirk" return tststring application = application([personnel], 'elleo.personnel', in_protocol=soap11(validator='lxml'), out_protocol=soap11()) wsgi_application = wsgiapplication(application)
when connect android program using ksoap, error. here code:
string soap_action = "http://192.168.1.100:8000/personnel"; string method_name = "personnel"; string namespace = "elleo.personnel"; string url = "http://192.168.1.100:8000/?wsdl"; try { soapobject request = new soapobject(namespace, method_name); soapserializationenvelope soapenvelope = new soapserializationenvelope(soapenvelope.ver11); soapenvelope.dotnet = true; soapenvelope.setoutputsoapobject(request); httptransportse transport = new httptransportse(url); transport.call(soap_action, soapenvelope); resultstring = (soapprimitive) soapenvelope.getresponse(); log.i(tag, "result celsius: " + resultstring); } catch (exception ex) { log.e(tag, "error: " + ex.getmessage()); }
i following error message:
<faultstring>:1:0:error:schemasv:schemav_cvc_complex_type_3_2_1: element '{elleo.personnel}personnel', attribute '{http://schemas.xmlsoap.org/soap/encoding/}root': attribute '{http://schemas.xmlsoap.org/soap/encoding/}root' not allowed.</faultstring>
any idea how solve this. small program try use establish communications. expand program if part work.
i found answer. not claim understand why work did. see how can remove namespace declarations in ksoap? more details.
here code added java program:
try { soapobject request = new soapobject(namespace, method_name); soapserializationenvelope soapenvelope = new soapserializationenvelope(soapenvelope.ver11); soapenvelope.dotnet = true; soapenvelope.setoutputsoapobject(request); soapenvelope.setaddadornments(false); httptransportse transport = new httptransportse(url); transport.call(soap_action, soapenvelope); resultstring = (soapprimitive) soapenvelope.getresponse(); log.i(tag, "result celsius: " + resultstring); } catch (exception ex) { log.e(tag, "error: " + ex.getmessage()); }