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
  client A to server B connects but client B to server A doesnt connect gerald 1 1,518 Aug-17-2024, 07:33 AM
Last Post: Gribouillis
  How to express null value klatlap 3 2,856 Mar-25-2023, 10:40 AM
Last Post: klatlap
  How to use xmlrpc from flrig? mamoman 3 2,790 Feb-10-2023, 06:25 PM
Last Post: Larz60+
  Multiple conditions, one is null moralear27 1 3,329 Sep-13-2020, 06:11 AM
Last Post: scidam
  I didnt get the NULL values salwa17 0 2,343 Jul-10-2020, 02:54 PM
Last Post: salwa17
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 7,168 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  g Null Byte using DictReader eshwinsukhdeve 13 12,403 May-15-2019, 08:50 AM
Last Post: buran
  wordpress-python-xmlrpc. I can import 1 file. How do I import the entire folder? SamLearnsPython 0 4,284 Jul-05-2018, 06:21 AM
Last Post: SamLearnsPython
  XMLRPC 'client' error SamLearnsPython 19 23,307 Jul-04-2018, 11:51 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