コード例 #1
0
ファイル: PHPClass2WSDL.php プロジェクト: williamamed/Raptor2
 /**
  * Generate the WSDL DOMDocument.
  *
  * @param boolean $withAnnotation Flag if only the methods with '@soap' annotation should be added.
  */
 public function generateWSDL($withAnnotation = false)
 {
     $qNameClassName = WSDL::typeToQName($this->class);
     $this->wsdl = new WSDL($qNameClassName, $this->uri);
     $port = $this->wsdl->addPortType($qNameClassName . 'Port');
     $binding = $this->wsdl->addBinding($qNameClassName . 'Binding', 'tns:' . $qNameClassName . 'Port');
     $this->wsdl->addSoapBinding($binding, $this->bindingStyle['style'], $this->bindingStyle['transport']);
     $this->wsdl->addService($qNameClassName . 'Service', $qNameClassName . 'Port', 'tns:' . $qNameClassName . 'Binding', $this->uri);
     $ref = new ReflectionClass($this->class);
     foreach ($ref->getMethods() as $method) {
         if ($withAnnotation === false || $method->getReflectionDocComment()->getAnnotationsCollection()->hasAnnotationTag('soap')) {
             $this->addMethodToWsdl($method, $port, $binding);
         }
     }
 }