How does the service module work? i am using drupal 6 and services 6.3x module but i am unable to use this module completely.
I have enabled rest server module also.
I added a new service and added resources to it.
I added node resource to it and i am able to fetch all the nodes in json format

what i am not able to understand is :-


The exact uri or may be the procedure to call getTree method in taxonomy_vocabulary resource
How to acccess all the methods (CRUD) functions under every resource enabled
The url -> mydomain.com/service/rest/node.json works for me but how can i access the getTree method ??


I am stuck on this like forever i have even posted jobs on the drupal site but i guess there are very rare people who have knowledge about this.

Edit :-

Live link is http://delvelogic.com/merchant/drupal-6.22/services/rest/taxonomy_vocabulary

The following is the java code i am using :-

    DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpResponse response = null;  
    HttpPost postMethod = new HttpPost("http://delvelogic.com/merchant/drupal-6.22/rest/taxonomy_vocabulary/getTree.json");
    postMethod.addHeader("Content-type", "application/x-www-form-urlencoded");
    postMethod.addHeader("Accept","application/json");
  //  postMethod.addHeader("Authorization", "basic " + Base64.encodeBytes(("admin"+":"+"admin123").getBytes()));
 //   httpClient.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT));

     List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();  
     nameValuePairs.add(new BasicNameValuePair("vid", ""+1));
     nameValuePairs.add(new BasicNameValuePair("parent", ""+1));
     nameValuePairs.add(new BasicNameValuePair("maxdepth",""+1));
    // nameValuePairs.add(new BasicNameValuePair())
    try{
     postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));  
     response = httpClient.execute(postMethod); 

     InputStream input = response.getEntity().getContent();
      BufferedReader rd = new BufferedReader(new InputStreamReader(input),input.toString().length());
     String line;
     StringBuilder sb =  new StringBuilder();
     while ((line = rd.readLine()) != null) {
            sb.append(line);
     }
     rd.close();
     uploadresponse = sb.toString();

     Log.d("Response", ""+uploadresponse);
    }catch (Exception e) {
        // TODO: handle exception
        e.printStackTrace();
    }


Also if there is any firefox add on so that i can actually see the method working ??

Edit Again :-

I have found this add on restclient to work on firefox

i choose the method as post
in the url i typed http://delvelogic.com/merchant/drupal-6.22/services/rest/taxonomy_vocabulary/getTree

added header :-

Content-type : application/x-www-form-urlencoded

Accept : application/json

request body :-

&amp;vid=1&amp;parent=1&amp;maxdepth=1

it gives me 404 not found with no vocabulary with id 1 found
Thanks in advance
According to the documentation the URLs shouldn't necessarily have .json at the end, but I guess this is a setting you've changed if it's working for the node functions. I know you're not going to like this answer (I'm fairly certain you've tried it before) but the URL is: mydomain.com/service/rest/taxonomy_vocabulary/getTree. I've even been through the service and rest_server modules' respective code and that is definitely what it should be.

For further proof look at the (valid, passed) test module for services taxonomy_vocabulary:

ServicesResourceTaxonomyTests::testVocabularyGetTree.

You'll see that the URLs accessed by this successfully passed test are: $path . '/taxonomy_vocabulary/getTree', where $path is the path to the endpoint (i.e. mymodule.com/service/rest/).

It really would help if you could provide a live link though so we can test to see if the problem is in your Java code or with Drupal (although the latter seems very unlikely).

EDIT

p.s. do comment on this answer as I have a lot of experience with the services module and I'm sure I can point you in the right direction with a bit more info. It pains me to see someone struggling with something that I've had nothing but joy with in the past!

ANOTHER EDIT

This is the response I get from http://delvelogic.com/merchant/drupal-6.22/services/rest/taxonomy_vocabulary:

&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;result&gt;
    &lt;nodes/&gt;
    &lt;module&gt;taxonomy&lt;/module&gt;
    &lt;name&gt;&lt;/name&gt;
    &lt;help&gt;&lt;/help&gt;
    &lt;relations&gt;0&lt;/relations&gt;
    &lt;hierarchy&gt;0&lt;/hierarchy&gt;
    &lt;multiple&gt;0&lt;/multiple&gt;
    &lt;required&gt;0&lt;/required&gt;
    &lt;tags&gt;0&lt;/tags&gt;
    &lt;weight&gt;0&lt;/weight&gt;
    &lt;vid&gt;4&lt;/vid&gt;
  &lt;/result&gt;


Notice the &lt;vid&gt;4&lt;/vid&gt; bit...I'm pretty sure the vid you should be looking for is 4, not 1!