Ejemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $version = $input->getArgument('version') ?: '*';
     $path = $input->getArgument('path');
     $doc = $this->resourceListing->getDocumentation($path);
     if ($doc instanceof DocumentationInterface) {
         if ($version == '*') {
             $version = $doc->getLatestVersion();
         }
         $resource = $doc->getResource($version);
         if (!$resource instanceof Resource) {
             throw new RuntimeException('Given version is not available');
         }
         $targetNamespace = $this->config['psx_soap_namespace'];
         $generator = new Generator\Xsd($targetNamespace);
         $output->write($generator->generate($resource));
     } else {
         throw new RuntimeException('Invalid resource');
     }
 }
Ejemplo n.º 2
0
Archivo: Wsdl.php Proyecto: seytar/psx
 protected function appendTypes(DOMElement $element, Resource $resource)
 {
     $types = $element->ownerDocument->createElement('wsdl:types');
     $schema = $element->ownerDocument->createElementNS('http://www.w3.org/2001/XMLSchema', 'xs:schema');
     $schema->setAttribute('targetNamespace', $this->targetNamespace);
     $schema->setAttribute('elementFormDefault', 'qualified');
     $schema->setAttribute('xmlns:tns', $this->targetNamespace);
     $xsdGenerator = new Xsd($this->targetNamespace);
     $xsdGenerator->appendSchema($schema, $resource);
     $types->appendChild($schema);
     $element->appendChild($types);
 }