ITrust / angular-xmlrpc

An AngularJS service which provides XML-RPC communication methods.
Apache License 2.0
11 stars 13 forks source link

json response for base64 type #7

Closed Harish-Ramamurthy closed 7 years ago

Harish-Ramamurthy commented 7 years ago

I have made the following xmlrpc call.

xmlrpc.callMethod('exportConfig', []).then(function(response) { console.log(response); console.log("Response Type: " + typeof(response)); console.log("Response Length: " + Object.keys(response).length); var reader = new FileReader(); var blob = new Blob([response], {type: 'application/zip'}); reader.onLoad = function () { console.log(this.result); }; reader.readAsDataURL(blob); });

The output is said to return the configuration as a data BLOB: base64.

The xmlrpc call is successful and I obtain the response in xml. I have attached the screenshot which I obtained from the network tab. ang_xmlrpc_network

But I don't receive the response in json. I don't obtain the dataURL in the console. I have attached the screenshot for the same. ang_xmlrpc_console

Kindly let me know if there is a workaround for this or have i made any mistake in my xmlrpc call. Thank you.

jchakra commented 7 years ago

Hi Harish-Ramamurthy, I think the problem comes from the method that converts <base64> tag to JSON does not exist. I will fix that as soon as possible. Thanks for your feedback !

jchakra commented 7 years ago

I just push a patch adding <base64> tag management. It converts it to a string value. Tell me if it's good for you :)

Cheers

Harish-Ramamurthy commented 7 years ago

Sorry for the late reply as I was in my Christmas vacation. I tested it, the base64 gets converted to a string value and it works fine for me. Thank you for your help.