Exemple #1
0
 public function createWsdl($classFileName, $nameSpaceUrl, $wsdlFile = null, $endPoint = null)
 {
     // Require the Class we are Parsing
     require_once $classFileName;
     $this->classDir = dirname($classFileName);
     // Strip Extension to get Class Name
     $this->className = $classFileName;
     $this->className = basename($this->className, ".inc");
     $this->className = basename($this->className, ".php");
     print "Creating Wsdl for Class: {$this->className}\n";
     // Calculate the EndPoint for this service
     $this->endPoint = $nameSpaceUrl . $endPoint;
     if (!$endPoint) {
         $this->endPoint = $nameSpaceUrl . $this->className . ".php";
     }
     // Get the WSDL File Name
     if (!$wsdlFile) {
         $wsdlFile = $this->className . ".wsdl";
     }
     // Create a WSDL File
     $wsdlDef = new WsdlDefinition();
     $wsdlDef->setDefinitionName($this->className);
     $wsdlDef->setClassFileName($classFileName);
     $wsdlDef->setWsdlFileName($wsdlFile);
     $wsdlDef->setNameSpace($nameSpaceUrl);
     $wsdlDef->setEndPoint($this->endPoint);
     $wsdl = new WsdlWriter($wsdlDef);
     /* 
             // Get the Methods from the Class
             $wsdlMethods = $this->getMethods();
     
             // Find the Complex Types
             $complexTypes = WsdlType::getComplexTypes($wsdlMethods);
     
             foreach ($complexTypes as &$complexType) {
                 $wsdl->addComplexType($complexType);
             }
     
             // Add Methods to the WSDL File
             foreach ($wsdlMethods as $wsdlMethod) {
                 $wsdl->addMethod($wsdlMethod);
             }
     
             // Write it to Disk
             $wsdl->save();
     */
     $wsdl->classToWsdl();
     $wsdl->save();
     return $wsdl->saveXML();
 }
Exemple #2
0
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.
	
	You should have received a copy of the GNU Affero General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
	require_once 'service.inc.php';

	if(isset($_GET['class']) && in_array($_GET['class'], $SOAPCLASSES)) {
		require_once 'wsdl-writer/WsdlDefinition.php';
		require_once 'wsdl-writer/WsdlType.php';
		require_once 'wsdl-writer/WsdlWriter.php';

		header('Content-type: text/xml');

		$class = basename($_GET['class']);

		# Skriv ut WSDL-fil för $class.
		$def = new WsdlDefinition();
		$def->setDefinitionName($class);
		$def->setClassFileName($class . '.php');
		$def->setWsdlFileName(strtolower($class)  . '.wsdl'); # Vet inte varför detta behövs.
		$def->setNameSpace(TEST_NS . strtolower($class));
		$def->setEndPoint(TEST_ENDPOINT . $class);
	
		$wsdl = new WsdlWriter($def);
		print $wsdl->classToWsdl();
	}
?>