Generates the WSDL for the given class.
@param string $className class name
@param string $serviceUrl Web service URL
@param string $encoding encoding of the WSDL. Defaults to 'UTF-8'.
@return string the generated WSDL
541170
public function generateWsdl($className, $serviceUrl, $encoding='UTF-8')
	{
		$this->operations=array();
		$this->types=array();
		$this->elements=array();
		$this->messages=array();
		if($this->serviceName===null)
			$this->serviceName=$className;
		if($this->namespace===null)
			$this->namespace='urn:'.str_replace('\\','/',$className).'wsdl';

		$reflection=new ReflectionClass($className);
		foreach($reflection->getMethods() as $method)
		{
			if($method->isPublic())
				$this->processMethod($method);
		}

		$wsdl=$this->buildDOM($serviceUrl,$encoding)->saveXML();

		if(isset($_GET['makedoc']))
			$this->buildHtmlDocs();

		return $wsdl;
	}
988577
@Nullable
    public static String classToSignature(String className) {
        if (className == null) {
            return null;
        } else if (className.startsWith(Values.SIG_ARRAY_PREFIX)) {
            // convert the classname inside the array
            return Values.SIG_ARRAY_PREFIX + classToSignature(className.substring(Values.SIG_ARRAY_PREFIX.length()));
        } else if (PRIMITIVE_TYPES.contains(className) || className.endsWith(Values.SIG_QUALIFIED_CLASS_SUFFIX)) {
            return className.replace('.', '/');
        } else {
            String primitive = PRIMITIVE_NAME_TO_SIG.get(className);
            if (primitive != null) {
                return primitive;
            }

            return Values.SIG_QUALIFIED_CLASS_PREFIX + className.replace('.', '/') + Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR;
        }
    }
711029
public static function generateClassName($name)
    {
        $name = str_replace("-", "_", $name);

        if (strstr($name, "\\")) {
            $composedName = "";
            foreach (explode("\\", $name) as $namespace) {
                $namespace = Inflector::underscore($namespace);
                $namespace = Inflector::classify($namespace);
                $composedName .= $namespace . "\\";
            }
        } else {
            $name = Inflector::underscore($name);
            $name = Inflector::classify($name);
        }

        $suffix = self::getClassNameSuffix();
        if (!preg_match("/$suffix$/", $name)) {
            $name .= $suffix;
        }

        if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new Exception(sprintf("We could not generate a valid PHP classname from %s", $name));
        }

        return $name;
    }
1325270
public function generateClassMap(Wsdl $wsdl): string
    {
        return $this->twig->render('class-map.html', [
            'wsdl' => $wsdl,
            'namespace' => $this->getNamespace(),
        ]);
    }
207162
public String serviceName_language_POST(String serviceName, OvhPleskLanguageTypeEnum language) throws IOException {
		String qPath = "/hosting/reseller/{serviceName}/language";
		StringBuilder sb = path(qPath, serviceName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "language", language);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, String.class);
	}
1201958
public function generateWsdl()
    {
        if (is_object($this->provider)) {
            $providerClass = get_class($this->provider);
        } else {
            $providerClass = $this->provider;
        }
        if ($this->wsdlCacheDuration > 0 && $this->cacheID !== false && ($cache = Yii::$app->get($this->cacheID, false)) !== null) {
            $key = 'Yii.WebService.' . $providerClass . $this->serviceUrl . $this->encoding;
            if (($wsdl = $cache->get($key)) !== false) {
                return $wsdl;
            }
        }
        $generator = Yii::createObject($this->generatorConfig);
        $wsdl = $generator->generateWsdl($providerClass, $this->serviceUrl, $this->encoding);
        if (isset($key, $cache)) {
            $cache->set($key, $wsdl, $this->wsdlCacheDuration);
        }
        return $wsdl;
    }
1118448
private function generateClass(): ServiceDTOGenerator
    {
        $this->DTOFile = (new PhpFile())
            ->addComment('This file is auto-generated.');

        $namespace = $this->inputData['namespace'] . '\\' . $this->inputData['module'] . 'Module\\' . $this->inputData['type'];

        $this->DTOClass = $this->DTOFile
            ->addNamespace($namespace)
            ->addClass($this->inputData['class'] . $this->inputData['type'])
            ->addComment($this->inputData['class'] . ' service ' . strtolower($this->inputData['type']) . PHP_EOL)
            ->addComment('@package ' . $namespace);

        return $this;
    }
883798
function nusoap_server($wsdl=false){
		parent::nusoap_base();
		// turn on debugging?
		global $debug;
		global $HTTP_SERVER_VARS;

		if (isset($_SERVER)) {
			$this->debug("_SERVER is defined:");
			$this->appendDebug($this->varDump($_SERVER));
		} elseif (isset($HTTP_SERVER_VARS)) {
			$this->debug("HTTP_SERVER_VARS is defined:");
			$this->appendDebug($this->varDump($HTTP_SERVER_VARS));
		} else {
			$this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined.");
		}

		if (isset($debug)) {
			$this->debug("In nusoap_server, set debug_flag=$debug based on global flag");
			$this->debug_flag = $debug;
		} elseif (isset($_SERVER['QUERY_STRING'])) {
			$qs = explode('&', $_SERVER['QUERY_STRING']);
			foreach ($qs as $v) {
				if (substr($v, 0, 6) == 'debug=') {
					$this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #1");
					$this->debug_flag = substr($v, 6);
				}
			}
		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
			$qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']);
			foreach ($qs as $v) {
				if (substr($v, 0, 6) == 'debug=') {
					$this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #2");
					$this->debug_flag = substr($v, 6);
				}
			}
		}

		// wsdl
		if($wsdl){
			$this->debug("In nusoap_server, WSDL is specified");
			if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) {
				$this->wsdl = $wsdl;
				$this->externalWSDLURL = $this->wsdl->wsdl;
				$this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL);
			} else {
				$this->debug('Create wsdl from ' . $wsdl);
				$this->wsdl = new wsdl($wsdl);
				$this->externalWSDLURL = $wsdl;
			}
			$this->appendDebug($this->wsdl->getDebug());
			$this->wsdl->clearDebug();
			if($err = $this->wsdl->getError()){
				die('WSDL ERROR: '.$err);
			}
		}
	}
391721
private function generateSwaggerForService(
        string $serviceName,
        AbstractService $service,
        string $method = null
    ) : array {
        $path = $definition = [];

        foreach ($service->getMethods() as $currentMethod) {
            if (!is_null($method) && $currentMethod != $method) {
                continue;
            }

            $reflection = $service->getReflectionMethod($currentMethod);

            $currentPath = [
                'operationId' => $currentMethod,
                'tags' => [str_replace('\\', ' ', $serviceName)],
                'parameters' => [],
                'responses' => [],
            ];

            $plainTextResponse = true;

            $comment = $reflection->getDefinition(Definition::COMMENT) ?
                $reflection->getDefinition(Definition::COMMENT)->getComment() : null;

            $comment .= $reflection->getDefinition(Definition::COMMENT_LONG) ?
                "\n\n" . $reflection->getDefinition(Definition::COMMENT_LONG)->getComment() : '';

            if ($comment) {
                $currentPath = ['description' => $comment] + $currentPath;
            }

            if ($reflection->getDefinition(Definition::AUTH)->getAuth() != 'None') {
                $currentPath['security'] = ['Auth' . $reflection->getDefinition(Definition::AUTH)->getAuth() => []];
            }

            $httpMethod = $reflection->getDefinition(Definition::HTTP_METHOD)->getHttpMethod();

            if ($httpMethod == 'POST') {
                $currentPath['consumes'] = ['application/x-www-form-urlencoded'];
            }

            // parameters
            if ($reflection->getDefinition(Definition::PARAM)) {
                /* @var $parameter Param */
                foreach ($reflection->getDefinition(Definition::PARAM) as $i => $parameter) {
                    /* @var $reflectionParameter \ReflectionParameter */
                    $reflectionParameter = $reflection->getParameters()[$i];

                    $parameterRow = [
                        'name' => $parameter->getVar(),
                        'in' => $httpMethod == 'POST' ? 'formData' : 'query',
                        'required' => !$reflectionParameter->isOptional(),
                        // "minimum" => 1,
                        // "maximum" => 10000
                    ];

                    if ($reflectionParameter->isOptional() && $reflectionParameter->getDefaultValue()) {
                        $parameterRow['default'] = $reflectionParameter->getDefaultValue();
                    }

                    if ($parameter->getComment()) {
                        $parameterRow['description'] = $parameter->getComment();
                    }

                    $parameterRow = array_merge($parameterRow, $this->getSwaggertype(
                        $parameter->getType(),
                        $parameter->getSubType()
                    ));

                    if ($parameterRow['type'] == 'array') {
                        $parameterRow['collectionFormat'] = 'multi';
                    }

                    $currentPath['parameters'][] = $parameterRow;
                }
            } else {
                unset($currentPath['parameters']);
            }

            // response
            if ($reflection->getDefinition(Definition::RESPONSE)) {
                /* @var $response Response */
                foreach ($reflection->getDefinition(Definition::RESPONSE) as $i => $response) {
                    $swaggerResponse = [
                        'headers' => ['X-Duration' => ['description' => 'Api Server ResponseTime', 'type' => 'number']],
                    ];

                    if ($response->getComment()) {
                        $swaggerResponse['description'] = $response->getComment();
                    }

                    if (sizeof($response->getType()) > 1) {
                        throw new \LogicException('Polymorphism is not yet supported');
                    }

                    if ($response->getType()[0] !== null) {
                        $return = $this->getSwaggertype($response->getType()[0]);
                        $swaggerResponse['schema'] = $return;
                    }

                    if (!$this->isPrimitive($response->getType())) {
                        $plainTextResponse = false;
                    }

                    $currentPath['responses'][$response->getStatusCode()] = $swaggerResponse;
                }
            }

            // headers
            if ($reflection->getDefinition(Definition::HEADER)) {
                /* @var $header Header */
                foreach ($reflection->getDefinition(Definition::HEADER) as $i => $header) {
                    $name = 'X-' . ucfirst($header->getHeaderName());
                    $value = $this->getSwaggertype($header->getType());

                    if ($header->getComment()) {
                        $value['description'] = $header->getComment();
                    }

                    $currentPath['responses'][$header->getStatusCode()]['headers'][$name] = $value;
                }
            }

            // exceptions
            if ($reflection->getDefinition(Definition::THROWS)) {
                /* @var $throw Throws */
                foreach ($reflection->getDefinition(Definition::THROWS) as $i => $throw) {
                    //@TODO: handle > 600 statusCode
                }
            }

            if ($plainTextResponse) {
                $currentPath['produces'] = [
                    'application/json',
                    'application/problem+json',
                    'text/plain',
                ];
            }

            $path['/' . str_replace('\\', '/', $serviceName) . '/' . $currentMethod][strtolower($httpMethod)] =
            $currentPath;
        }

        foreach ($this->models as $name => $model) {
            $swaggerDefinition = [
                'required' => [],
                'properties' => [],
            ];

            foreach ($model->getDefinitions() as $property => $currentDefinition) {
                if (!$currentDefinition->isNullable()) {
                    $swaggerDefinition['required'][] = $property;
                }

                if (sizeof($currentDefinition->getType()) > 1) {
                    throw new \LogicException('Polymorphism is not yet supported');
                }

                $swaggerProperty = $this->getSwaggertype(
                    $currentDefinition->getType()[0],
                    $currentDefinition->getSubType()
                );

                if ($currentDefinition->getComment()) {
                    $swaggerProperty = ['description' => $currentDefinition->getComment()] + $swaggerProperty;
                }

                $swaggerDefinition['properties'][$property] = $swaggerProperty;
            }

            $definition[$this->normalizeType($name)] = $swaggerDefinition;
        }

        return [$path, $definition];
    }
319728
public static function ws()
    {
        if (!isset(self::core()->soap)) {
            //====================================================================//
            // WEBSERVICE INITIALISATION
            //====================================================================//
            // Initialize SOAP WebServices Class
            self::core()->soap = new Webservice();

            //====================================================================//
            // Initialize WebService Configuration Array
            self::core()->soap->setup();

            //====================================================================//
            //  Load Translation File
            self::translator()->load('ws');
        }

        return self::core()->soap;
    }
1160958
private function generateRequestParserObject($className, RequestParser $parser)
    {
        $cacheKey = str_replace('\\', '', $className . get_class($parser));
        $cacheItem = $this->cache->getItem($cacheKey);
        $return = $cacheItem->get();
        if ($return === null) {
            $return = $this->parserGenerator->populateRequestParser($className, $parser, $this);
            $cacheItem->set($return);
            $this->cache->save($cacheItem);
        }

        return $return;
    }
896224
public static final function toServiceName(string $serviceName): string
    {
        // foo-bar => FooBar
        $serviceName = ucfirst($serviceName);
        if (strpos($serviceName, '-')) {
            $serviceName = preg_replace_callback('~-([a-z])~i', function($match) {
                return ucfirst($match[1]);
            }, $serviceName);
        }

        // foo-bar => FooBarService
        if ($serviceName == Service::SERVICE_NAME_SUFFIX || substr($serviceName, -7) != Service::SERVICE_NAME_SUFFIX) {
            $serviceName .= Service::SERVICE_NAME_SUFFIX;
        }

        return $serviceName;
    }
929408
public function handleClass($class_name, $force=false)
    {
        if (is_string($class_name)) {
            $entity_class = str_replace('Service', '', $class_name);
        } elseif (is_object($class_name)) {
            $entity_class = get_class($class_name);
        } else {
            throw new \Exception('param $class_name is not classname or object');
        }
        
        $disco = new SoapDiscovery($entity_class);
        
        if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'wsdl')==0) {
            header("Content-type: text/xml");
            echo $disco->getWSDL();
        } else {
            $options = [
                'soap_version' => $this->options['soap_version'],
            ];
            $wsdl_url = $disco->createWSDL();
            
            $servidorSoap = new SoapServer($wsdl_url, $options);
            $servidorSoap->setClass($entity_class);
            $servidorSoap->handle();
        }
    }
208198
public static function ExtractNameSpace ($class_name, $encoding = self::DEFAULT_ENCODING) {
		return (mb_substr($class_name, mb_strlen($class_name, $encoding) - 1, 1, $encoding) === static::NAMESPACE_SEPARATOR)
		 ? $class_name
		 : mb_substr( $class_name, 0, mb_strrpos($class_name, static::NAMESPACE_SEPARATOR, 0, $encoding), $encoding);
	}
281425
public function make($class, $wsdl, array $config = [])
    {
        $reflectionClass = new ReflectionClass($class);

        /** @var SoapClient $client */
        $client = $reflectionClass->newInstanceArgs([ $wsdl, $config ]);

        return $client;
    }
723926
private function getNewEmbeddableFqnFromClassName(string $className): string
    {
        return $this->namespaceHelper->tidy(
            $this->projectRootNamespace . '\\'
            . implode('\\', \array_slice($this->archetypeObjectSubDirectories, 1))
            . '\\' . $className
        );
    }
945409
function serialize($charset_encoding='')
		{
			if ($charset_encoding != '')
				$this->content_type = $this->content_type . '; charset=' . $charset_encoding;
			else
				$this->content_type = $this->content_type;
			$this->payload = serialize_ezjscoreresp($this, $charset_encoding, $this->content_type);
			return $this->payload;
		}