Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:55:11+00:00 2026-06-18T06:55:11+00:00

As the name xmlrpc implies, this transfer protocol relies on XML to carry data,

  • 0

As the name xmlrpc implies, this transfer protocol relies on XML to carry data, and cannot transfer binary data, or non-printable ASCII-characters (\n, \b, chr(2),…) [or can it?].

I would like to know if there is a way to transfer a character string safely from a client to a server with minimal impact on the coding (i.e. ONLY on the client side). I tried the xmlrpclib.Binary class but this only seem to work with files.

Testcode, server.py:

def output(text):
    print "-".join([str(ord(x)) for x in text])

from SimpleXMLRPCServer import SimpleXMLRPCServer
server = SimpleXMLRPCServer(('localhost', 1234))
server.register_function(output)
server.serve_forever()

client.py:

import xmlrpclib
device = xmlrpclib.ServerProxy("http://localhost:1234/RPC2")
device.output(".\n."+chr(2))

Expected outcome:

46-10-46-2

Seen outcome (on server side):

xmlrpclib.Fault: <Fault 1: "<class 'xml.parsers.expat.ExpatError'>:not well-formed (invalid token): line 7, column 1">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:55:12+00:00Added an answer on June 18, 2026 at 6:55 am

    You could try encoding your binary data in a text format in the client and decoding it back into binary in the server. One encoding you could use is base64.

    In your client:

    import xmlrpclib
    import base64
    device = xmlrpclib.ServerProxy("http://localhost:1234/RPC2")
    device.output(base64.b64encode(".\n."+chr(2)))
    

    In your server:

    import base64
    def output(text):
        print "-".join([str(ord(x)) for x in base64.b64decode(text)])
    
    from SimpleXMLRPCServer import SimpleXMLRPCServer
    server = SimpleXMLRPCServer(('localhost', 1234))
    server.register_function(output)
    server.serve_forever()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this sample XML-RPC response: <struct> <member><name>post_id</name><value><string>131</string></value></member> <member><name>post_title</name><value><string>Test with secret password</string></value></member> <member><name>post_date</name><value><dateTime.iso8601>20080404T09:38:05</dateTime.iso8601></value></member> <member><name>post_thumbnail</name><value><string>http://localhost/~herop-kde/wordpress/wp-content/themes/twentyeleven/images/thumbnails/119.jpg</string></value></member>
This answer implies I can use getattr on an xmlrpc server proxy. However, in
I'm currently retrieving data using XML-RPC, this is what I have: Object[] params =
I am using XMLRPC to build an XML structure that passes across product information
Hello i have somme problems to write a simple XML-RPC client in PHP. This
I have following XMLRPC response <value><struct> <member><name>dedicatedAccountID</name><value><i4>1</i4></value></member> <member><name>dedicatedAccountValue1</name><value><string>0</string></value></member> <member><name>expiryDate</name><value><dateTime.iso8601>99991231T00:00:00+1200</dateTime.iso8601></value></member> </struct></value> <value><struct> <member><name>dedicatedAccountID</name><value><i4>2</i4></value></member> <member><name>dedicatedAccountValue1</name><value><string>15635</string></value></member> <member><name>expiryDate</name><value><dateTime.iso8601>99991231T00:00:00+1200</dateTime.iso8601></value></member>
[{name:Mark,Surname:Gaux}] [{Job:2,Type:Office}] I have this JSON echoed by a PHP file on the server
I'm trying to talk to supervisor over xmlrpc. Based on supervisorctl (especially this line
I've found this guide on internet to publish on Wordpress using XML-RPC inside my
{ data: [ { name: acac, id: 00000 }, { name: adcd, id: 1111111

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.