public function testGenerateWSDLForURIWithAllComponents() { $class = 'PHP2WSDL\\Test\\Fixtures\\TestGenerateWSDLForURIWithAllComponents'; $expectedWSDLFile = __DIR__ . '/Expected/TestGenerateWSDLForURIWithAllComponents.wsdl'; $uri = 'http://*****:*****@example.com:81/path/file.ext?r=a/b/c&a=1&b[]=2&b[]=3'; $wsdlGenerator = new PHPClass2WSDL($class, $uri); $wsdlGenerator->generateWSDL(false); $actual = $wsdlGenerator->dump(); $this->assertWSDLFileEqualsWSDLString($expectedWSDLFile, $actual); }
/** * @see Service::generateWsdl() */ protected function generateWsdlInternal($className, $serviceUrl) { $wsdlGenerator = new PHPClass2WSDL($className, $serviceUrl); $wsdlGenerator->generateWSDL(true); return $wsdlGenerator->dump(); }
<?php use PHP2WSDL\PHPClass2WSDL; include "php2wsdlxxx/vendor/autoload.php"; include "library.php"; $class = "Calculator"; $serviceURI = "http://localhost/test/web-service/server/service.php"; $wsdlGenerator = new PHPClass2WSDL($class, $serviceURI); // Generate thw WSDL from the class adding only the public methods that have @soap annotation. $wsdlGenerator->generateWSDL(true); $wsdlXML = $wsdlGenerator->dump(); echo $wsdlXML;