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.5
diff -u -r1.2.2.2.2.2.2.5 soap_server.module
--- soap_server.module	22 Jan 2011 03:21:20 -0000	1.2.2.2.2.2.2.5
+++ soap_server.module	24 Jan 2011 15:43:26 -0000
@@ -18,17 +18,6 @@
  * Implementation of hook_menu().
  */
 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',
@@ -124,11 +113,27 @@
   $service_endpoint = url($endpoint->path, array('absolute' => TRUE));
   // get the content of the schema for each hose_xml profile using the standard namespace xs:
   $methods = _soap_server_get_methods($endpoint->name);
+  dsm($methods);
   foreach ($methods as $method_name => $method_config) {
     // requests can specify which field to use to identify the node - default is nid
+    $parts = "";
+    // add parameters from the args array in the resource
+    foreach ((array)$method_config['args'] as $arg) {
+      switch ($arg['type']) {
+        case 'int':
+        case 'string':
+        case 'struct':
+          $parts .= "
+    <part name='"  . $arg['name'] ."' type='". $arg['type'] ."' />"; 
+          break;
+        // we can work out how to deal with other parameter types later
+        default:
+          $parts .= "
+    <part name='". $arg['name'] ."' type='xsd:any'/>";
+      }    
+    }
     $requests .= "
-  <message name='". $method_name ."_request'>
-    <part name='request_object' type='xsd:any'/>
+  <message name='". $method_name ."_request'>". $parts ."
   </message>";
     $responses .= "
   <message name='". $method_name ."_response'>
@@ -226,17 +231,32 @@
 
 /**
  * Return a list of service methods for the endopint
+ * Method names are created from {resource}_{method} or {resource}_action_{method}
+ * NB: These method names are different from the XMLRPC names because PHP5 can't have a . in function
+ * names
  *
  * @param $endpoint
  */
 function _soap_server_get_methods($endpoint) {
   $resources = services_get_resources($endpoint);
-  foreach ($resources as $resource => $resource_info) {
-    foreach ($resource_info['actions'] as $method_name => $method_data) {
-      // We are translating the method names to avoid problems with XMLRPC's
-      // resource.method notation in PHP 5.
-      $hose_method_name = $resource .'_'. $method_name;
-      $supported_methods[$hose_method_name] = $method_data['callback'];
+  dsm($resources);
+  foreach ($resources as $resource_name => $resource_info) {
+    foreach ($resource_info as $method_name => $method_data) {
+      if (!is_array($method_data)) {
+        // it's not a method
+        continue;
+      }
+      if ( isset($method_data['callback'])) {
+        // if this element has a callback we'll assume it is a method
+        $soap_method_name = $resource_name .'_'. $method_name;
+        $supported_methods[$soap_method_name] = $method_data;
+      }
+      if ($method_name == "actions") {
+        foreach ($method_data as $action_name => $action_data) {
+          $soap_method_name = $resource_name .'_action_'. $action_name;
+          $supported_methods[$soap_method_name] = $action_data;
+        }
+      }
     }
   }
   return $supported_methods;

