[wsf-c-dev] svn commit r211 - wsf/php/src/scripts

svn at wso2.com svn at wso2.com
Tue Dec 12 04:35:49 PST 2006


Author: buddhika
Date: Tue Dec 12 04:35:48 2006
New Revision: 211

Modified:
   wsf/php/src/scripts/WS_WsdlConsts.php
   wsf/php/src/scripts/WS_WsdlOperations.php
Log:
 Modifing scripts for wsdl generation


Modified: wsf/php/src/scripts/WS_WsdlConsts.php
==============================================================================
--- wsf/php/src/scripts/WS_WsdlConsts.php	(original)
+++ wsf/php/src/scripts/WS_WsdlConsts.php	Tue Dec 12 04:35:48 2006
@@ -56,8 +56,8 @@
 				'name' =>'unsigned long'),
 	'unsignedInt' => array('ns'   => self::WS_SOAP_XML_SCHEMA_NAMESPACE,
 			       'name' =>'unsigned Int'),
-	'boolean'    => array('ns'   => self::WS_SOAP_XML_SCHEMA_NAMESPACE,
-			  'name' => 'boolean'),
+	'Any'    => array('ns'   => self::WS_SOAP_XML_SCHEMA_NAMESPACE,
+			  'name' => 'Any'),
 	'negativeInteger'  => array('ns'   => self::WS_SOAP_XML_SCHEMA_NAMESPACE,
 			  'name' => 'int'),
 	'gYear' => array('ns'   => self::WS_SOAP_XML_SCHEMA_NAMESPACE,

Modified: wsf/php/src/scripts/WS_WsdlOperations.php
==============================================================================
--- wsf/php/src/scripts/WS_WsdlOperations.php	(original)
+++ wsf/php/src/scripts/WS_WsdlOperations.php	Tue Dec 12 04:35:48 2006
@@ -36,28 +36,49 @@
 	$operation = new ReflectionFunction($operationName);
 	$doc_comment = $operation->getDocComment();
 
-	if(preg_match_all('|@param\s+(?:object\s+)?(\w+)\s+\$(\w+)|', $doc_comment, 
-			  $matches, PREG_SET_ORDER)) 
+	if (!$doc_comment) 
 	{
-	    foreach($matches as $match) 
-	    {
-		$this->createdTypes[$match[1]] = 1;
+ 	    foreach($operation->getParameters() as $i => $param)
+ 	    {
+		$match[2] = $param->getName();
+		$match[1] = "Any";
+
+		$this->createdTypes[$match[1]] = 2;
 		$this->operations[$operationName][self::WS_OPERATION_INPUT_TAG][] = 
 		    array(self::WS_OPERATION_NAME_TAG => $match[2], 
 			  self::WS_OPERATION_TYPE_TAG => $match[1]);
 	    }
-	   
-	}
-	if(preg_match('|@return\s+(?:object\s+)?(\w+)|', $doc_comment, $match)) 
-	{
-	    $this->createdTypes[$match[1]] = 1;
+
+	    $this->createdTypes[$match[1]] = 2;
 	    $this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG][] = 
 		array(self::WS_OPERATION_NAME_TAG => self::WS_OPERATION_RET_TAG,
 		      self::WS_OPERATION_TYPE_TAG => $match[1]);
+	    
 	}
-	
-    }
-}
+	else
+	{
+	    if(preg_match_all('|@param\s+(?:object\s+)?(\w+)\s+\$(\w+)|', $doc_comment, 
+			      $matches, PREG_SET_ORDER)) 
+	    {
+		foreach($matches as $match) 
+		{
+		    $this->createdTypes[$match[1]] = 1;
+		    $this->operations[$operationName][self::WS_OPERATION_INPUT_TAG][] = 
+			array(self::WS_OPERATION_NAME_TAG => $match[2], 
+			      self::WS_OPERATION_TYPE_TAG => $match[1]);
 
+		}
+		
+	    }
+	    if(preg_match('|@return\s+(?:object\s+)?(\w+)|', $doc_comment, $match)) 
+	    {
+		$this->createdTypes[$match[1]] = 1;
+		$this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG][] = 
+		    array(self::WS_OPERATION_NAME_TAG => self::WS_OPERATION_RET_TAG,
+			  self::WS_OPERATION_TYPE_TAG => $match[1]);
+	    }	
+	}
+    }
 
+}
 ?>
\ No newline at end of file




More information about the Wsf-c-dev mailing list