0

am working in android and iOS mobile app development using HTML5. Am new in XML-RPC. Am using jQuery XML-RPC for the XML parsing.

Currently I read the values from Server to my Mobile App. Here its XML :

<?xml version='1.0'?>
<methodCall>
<methodName>execute</methodName>
  <params>
      <param><value><string>database_name</string></value></param>
      <param><value><int>1</int></value></param>
      <param><value><string>password</string></value></param>
      <param><value><string>universal.contract.merchant.application</string></value></param>
      <param><value><string>read</string></value></param>
      <param><value><array><data><value><int>23</int></value></data></array></value></param>
      <param><value><array><data><value><string>location_dba</string></value></data></array></value></param>
  </params>
</methodCall>

Code for READ data from server:

$.xmlrpc({
                        url: 'http://myurl/xmlrpc/object',
                        methodName: 'execute',
                        params: ['database_name',1,'password','universal.contract.merchant.application','read',[23],['location_dba']],
                        success: function(response, status, jqXHR) {
console.log(JSON.stringify(response)); 
alert(JSON.stringify(response));},
                        error: OnError

                    });

Read method is working Perfectly.

Then I want to Write the values to Server

Here I have shared its XML ;

<?xml version='1.0'?>
<methodCall>
<methodName>execute</methodName>
  <params>
      <param><value><string>database_name</string></value></param>
      <param><value><int>1</int></value></param>
      <param><value><string>password</string></value></param>
      <param><value><string>universal.contract.merchant.application</string></value></param>
      <param><value><string>write</string></value></param>
      <param><value><array><data><value><int>23</int></value></data></array></value></param>
      <param><value><struct><member><name>location_dba</name><value><string>test lead</string></value></member></struct></value></param>
  </params>
</methodCall>

How can i do its code using jQuery? Anybody can help me please? :(

ULLAS MOHAN.V
  • 1,521
  • 1
  • 19
  • 36

1 Answers1

0

Finally i got its answer....

For write values to Server ;

params: ['database_name',1,'password','universal.contract.merchant.application','write',[23],{location_dba:'test lead'}],
        console.log(JSON.stringify(response)); 
alert(JSON.stringify(response));},
                        error: OnError

Its works ! :)

ULLAS MOHAN.V
  • 1,521
  • 1
  • 19
  • 36