Python Forum
xmlrpc.client, ServerProxy and null return
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
xmlrpc.client, ServerProxy and null return
#1
I have a simple bit of code that accesses an XMLRPC server in this case to delete some user accounts.

def __init__(self, host, token):
    url = host + '/webservice/xmlrpc/server.php?wstoken=' + token
    self.proxy = xmlrpc.client.ServerProxy(url)

def core_user_delete_users(self, id):
    ids = [id]
    self.proxy.core_user_delete_users(ids)
    return
Now this actually works fine. The server correctly deletes the users. However, it (also) correctly returns nothing at all to the client. This (I am assuming anyway) causes an error...

Error:
File "pymoosh.py", line 62, in <module> moodle.core_user_delete_users(id) File "/home/howard/Repos/webservice/moodle.py", line 14, in core_user_delete_users self.proxy.core_user_delete_users(ids) File "/usr/lib/python3.5/xmlrpc/client.py", line 1092, in __call__ return self.__send(self.__name, args) File "/usr/lib/python3.5/xmlrpc/client.py", line 1432, in __request verbose=self.__verbose File "/usr/lib/python3.5/xmlrpc/client.py", line 1134, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python3.5/xmlrpc/client.py", line 1150, in single_request return self.parse_response(resp) File "/usr/lib/python3.5/xmlrpc/client.py", line 1320, in parse_response p.close() File "/usr/lib/python3.5/xmlrpc/client.py", line 447, in close parser.Parse(b"", True) # end of data xml.parsers.expat.ExpatError: no element found: line 1, column 0
As it basically works, I am assuming that this is complaining about no response being sent.

Is this the case and/or is there some way around it?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to express null value klatlap 3 815 Mar-25-2023, 10:40 AM
Last Post: klatlap
  How to use xmlrpc from flrig? mamoman 3 1,061 Feb-10-2023, 06:25 PM
Last Post: Larz60+
  value null when update in json file 3lnyn0 6 3,082 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  Multiple conditions, one is null moralear27 1 2,166 Sep-13-2020, 06:11 AM
Last Post: scidam
  I didnt get the NULL values salwa17 0 1,555 Jul-10-2020, 02:54 PM
Last Post: salwa17
  Find only the rows containing null values Bhavika 2 2,403 Jun-10-2020, 01:25 PM
Last Post: Bhavika
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,823 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  g Null Byte using DictReader eshwinsukhdeve 13 7,374 May-15-2019, 08:50 AM
Last Post: buran
  Array/Jarray problem contains null value? Maverick0013 1 3,933 Aug-10-2018, 12:56 PM
Last Post: Windspar
  wordpress-python-xmlrpc. I can import 1 file. How do I import the entire folder? SamLearnsPython 0 3,232 Jul-05-2018, 06:21 AM
Last Post: SamLearnsPython

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020