Index: soap_server.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/soap_server/soap_server.module,v
retrieving revision 1.2.2.2.2.2.2.4
diff -u -r1.2.2.2.2.2.2.4 soap_server.module
--- soap_server.module	21 Jan 2011 23:18:21 -0000	1.2.2.2.2.2.2.4
+++ soap_server.module	22 Jan 2011 00:39:41 -0000
@@ -16,37 +16,41 @@
 
 /**
  * Implementation of hook_menu().
+ *
+ * Provides a custom local task to handle the WSDL generation
  */
 function soap_server_menu() {
-  /* @TODO: remove this if is not necessary, but don't leave commented menu
-   * entries, it may lead to confusion assuming the menu call back exists.
-   *
-  $items['soap_server/wsdl/%endpoint'] = array(
-    'type' => MENU_CALLBACK,
-    'title' => 'Soap Server 3 WSDL',
-    'page callback' => 'soap_server_wsdl_output',
-    'page arguments' => array(2),
-    'access arguments' => array('access soap server'),
-  );
-  */
-  $items['soap_server/debug_wsdl/%endpoint'] = array(
-    'type' => MENU_CALLBACK,
-    'title' => 'Soap Server 3 Debug WSDL',
-    'page callback' => 'soap_server_debug_wsdl',
-    'page arguments' => array(2),
-    'access arguments' => array('debug soap server'),
-  );
-    $items['soap_server/debug_client/%endpoint/%node'] = array(
-    'title'            => 'Soap Server Debug Client',
-    'access arguments' => array('debug soap server'),
-    'page callback'    => 'soap_server_debug_client',
-    'page arguments'   => array(2, 3),
-    'type'             => MENU_CALLBACK,
+  $items['admin/build/services/%endpoint/wsdl'] = array(
+    'type'              => MENU_LOCAL_TASK,
+    'title'             => 'WSDL',
+    'page callback'     => 'soap_server_debug_wsdl',
+    'page arguments'    => array(3),
+    'access callback'   => 'soap_server_debug_wsdl_access',
+    'access arguments'  => array(3),
+    'weight'            => 10,
   );
   return $items;
 }
 
 /**
+ * Custom access function to show the WSDL local task tab when the edited
+ * endpoint is a SOAP endopint.
+ *
+ * @param $endpoint
+ *   The endpoint being edited.
+ * @return
+ *   TRUE if the endpoint is a SOAP endpoint, and the user hass 'administer
+ *   services' permission.
+ */
+function soap_server_debug_wsdl_access($endpoint) {
+  if (user_access('administer services')) {
+    return ($endpoint->server === 'soap_server');
+  }
+
+  return FALSE;
+}
+
+/**
  * endpoint menu loader
  *
  * Return the services endpoint object from the endpoint name.
@@ -62,11 +66,8 @@
 }
 
 /**
- * Implementation of hook_perm().
+ * Services 3 hooks.
  */
-function soap_server_perm() {
-  return array('access soap server', 'debug soap server');
-}
 
 /**
  * Implementation of hook_server_info().
@@ -79,9 +80,6 @@
   );
 }
 
-/**
- * Services 3 hooks.
- */
 
 /**
  * Implementation of hook_server().

