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

  • SEARCH
  • Home
  • 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 8579921
In Process

The Archive Base Latest Questions

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

This is jointly an xmlrpc question. I have a string of data coming in

  • 0

This is jointly an xmlrpc question. I have a string of data coming in from a .wav file. I read the file in, with file_get_contents() then I have to submit that information to an xmlrpc server (which I did not create). It takes the .wav audio data in base64. I have tried using base64_encode(), but that also returns the “string” type. I thought that maybe This php guide on xmlrpc_set_type would help, but this returns an object containing an array that contains a base64 encoded string.

Is there a way to set the string that I am working with as type base64?

this is what I have so far, that is creating errors:

$data = base64_encode(file_get_contents('myfile.wav', NULL, NULL, 44));
$request = xmlrpc_encode_request('service',array('AudioData'=>$data));

I have tried this as well:

$data = file_get_contents('myfile.wav', NULL, NULL, 44);
$request = xmlrpc_encode_request('service',array('AudioData'=>xmlrpc_set_type($data, 'base64')));

This is the response I get:

["faultCode"]=> int(0) ["faultString"]=> string(155) "request contains string value where base64 expected

EDIT:

I am aware that base64 is not a type. Obviously the server I am using will not except a string of base64 encoded data, so my question is how to make that work.

  • 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-11T20:42:57+00:00Added an answer on June 11, 2026 at 8:42 pm

    The xmlrpc_set_type function can be used to “mark” a value as being of a specific type (base64 or datetime) in a XML-RPC request. It returns a boolean indicating if the operation was successful.

    Basically, what happens is that the value is wrapped in a standard PHP class object along with its type and the variable passed as a reference to xmlrpc_set_type holds this object instead of the original raw value.

    When calling xmlrpc_encode_request, the same variable previously passed as a reference to xmlrpc_set_type in order to declare the value type, should be embedded in a $params array passed as second argument.

    Please note, these functions are still considered as experimental and should be used with much care.

    Example:

    <?php
    
    $method = 'app.service';
    
    // $value contains raw content
    xmlrpc_set_type($value, 'base64'); 
    
    // $request contains base64 encoded content
    $request = xmlrpc_encode_request($method, array($value); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simple program to write to and read from a mysql database.
this is what i have so far: type u = {str : string} //some
This may be an unusual question, but are there any resources people have come
this is my first question in here, and I would like to ask if
This question is directly related to this SO question I posed about 15 minutes
This question is kind of a follow up to this question I asked a
This should be a simple one: I have an observableArray object called To in
This is my code: <CheckBox android:id=@+id/sprint_checkbox android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/sprint_game /> <CheckBox android:id=@+id/marathon_checkbox android:layout_width=fill_parent android:layout_height=wrap_content
This is the file auth.txt (username password) paolo 1234 luca 0000 marci 1000 And
This is my first attempts at creating a data-mart/warehouse and I am a little

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.