Request webservices in drupal 6

1. Following is the xml format for sending the request $xmlrequest= "<?xml version='1.0'?> <methodCall>   <methodName>myservices.test</methodName>     <params>       <param>         <value>           <string></string>           <int></int>         </value>       </param>     </params>   </methodCall>"; $ch = curl_init('http://localhost/drupal/services/xmlrpc'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $xmlrequest); $result = curl_exec ($ch); echo $result; curl_close ($ch); Save the file and execute in the web browser. Note: 2. methodname will be the name of method in your service. 3. If you want to pass parameters then send it in following format You should always maintain the order, as the values will be read in same order at the server side.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>

More information about formatting options