/**
  * The method takes care of looping among WSDLS as much time as it is needed
  * @see \WsdlToPhp\PackageGenerator\Generator\ParserInterface::parse()
  */
 public final function parse()
 {
     $wsdl = $this->generator->getWsdl();
     if ($wsdl instanceof Wsdl) {
         $content = $wsdl->getContent();
         if ($content instanceof WsdlDocument) {
             if ($this->isWsdlParsed($wsdl) === false) {
                 $this->setTags($content->getElementsByName($this->parsingTag()));
                 if (count($this->getTags()) > 0) {
                     $this->parseWsdl($wsdl);
                 }
             }
             foreach ($content->getExternalSchemas() as $schema) {
                 if ($this->isSchemaParsed($wsdl, $schema) === false) {
                     $schemaContent = $schema->getContent();
                     if ($schemaContent instanceof SchemaDocument) {
                         $this->setTags($schemaContent->getElementsByName($this->parsingTag()));
                         if (count($this->getTags()) > 0) {
                             $this->parseSchema($wsdl, $schema);
                         }
                     }
                     $this->setSchemaAsParsed($wsdl, $schema);
                 }
             }
         }
         $this->setWsdlAsParsed($wsdl);
     }
 }
示例#2
0
 /**
  * @param MethodModel $method
  * @return string
  */
 public static function getOperationMethodReturnType(MethodModel $method, Generator $generator)
 {
     $returnType = $method->getReturnType();
     if (($struct = $generator->getStruct($returnType)) instanceof StructModel && $struct->getIsStruct() && !$struct->getIsRestriction()) {
         $returnType = $struct->getPackagedName(true);
     }
     return $returnType;
 }
示例#3
0
 /**
  * @param MethodModel $method
  * @return string
  */
 public static function getOperationMethodReturnType(MethodModel $method, Generator $generator)
 {
     $returnType = $method->getReturnType();
     if (($struct = $generator->getStruct($returnType)) instanceof StructModel && !$struct->getIsRestriction()) {
         if ($struct->getIsStruct()) {
             $returnType = $struct->getPackagedName(true);
         } elseif ($struct->isArray()) {
             if (($structInheritance = $struct->getInheritanceStruct()) instanceof StructModel) {
                 $returnType = sprintf('%s[]', $structInheritance->getPackagedName(true));
             } else {
                 $returnType = $struct->getInheritance();
             }
         }
     }
     return $returnType;
 }
 /**
  *
  */
 public function testGetSoapClientStreamContextOptions()
 {
     $options = GeneratorOptionsTest::optionsInstance();
     $options->setOrigin(self::onlineWsdlBingPath())->setDestination(self::getTestDirectory())->setSoapOptions(array(AbstractSoapClientBase::WSDL_STREAM_CONTEXT => stream_context_create(array('https' => array('X-Header' => 'X-Value'), 'ssl' => array('ca_file' => basename(__FILE__), 'ca_path' => __DIR__, 'verify_peer' => true)))));
     $instance = new Generator($options);
     // HTTP headers are added to the context options with certain PHP version on certain platform
     // this test is focused on the defined options and not those which are added after
     // so we remove those we are not interested in!
     $contextOptions = $instance->getSoapClient()->getSoapClientStreamContextOptions();
     foreach (array_keys($contextOptions) as $index) {
         if ($index !== 'https' && $index !== 'ssl') {
             unset($contextOptions[$index]);
         }
     }
     $this->assertSame(array('https' => array('X-Header' => 'X-Value'), 'ssl' => array('ca_file' => basename(__FILE__), 'ca_path' => __DIR__, 'verify_peer' => true)), $contextOptions);
 }