/**
  * Creates a new operation with from a given annotated php method.
  *
  * @param ReflectionAnnotatedMethod $method An annotated php method
  *
  * @return ckWsdlOperation An operation, which's input corresponds to the parameters and which's output
  *                         corresponds to the return value of the given php method.
  */
 public static function create(ReflectionAnnotatedMethod $method)
 {
     $name = $method->getAnnotation('WSMethod')->getName();
     $result = new ckWsdlOperation();
     $result->setName($name);
     $params = ckDocBlockParser::parseParameters($method->getDocComment());
     $return = ckDocBlockParser::parseReturn($method->getDocComment());
     $headers = $method->getAllAnnotations('WSHeader');
     $result->input = new ckWsdlMessage($name . 'Request');
     $result->output = new ckWsdlMessage($name . 'Response');
     foreach ($headers as $header) {
         $type = ckXsdType::get($header->type);
         $type->setName($header->name);
         ckXsdType::set($header->name, $type);
         ckXsdType::set($header->type, null);
         $result->input->addPart(new ckWsdlPart($header->name, $type, true));
         $result->output->addPart(new ckWsdlPart($header->name, $type, true));
     }
     foreach ($params as $param) {
         $type = ckXsdType::get($param['type']);
         $result->input->addPart(new ckWsdlPart($param['name'], $type));
     }
     if (!empty($return)) {
         $type = ckXsdType::get($return['type']);
         $result->output->addPart(new ckWsdlPart('result', $type));
     }
     return $result;
 }
 /**
  * Creates a new complex type object for the given php class.
  *
  * @param string $name A name of a php class
  *
  * @return ckXsdComplexType The complex type object
  */
 public static function create($name)
 {
     $reflectClass = new ReflectionAnnotatedClass($name);
     $result = new ckXsdComplexType($name, ckXsdNamespace::get('tns'));
     ckXsdType::set($name, $result);
     foreach (ckAbstractPropertyStrategy::getPropertyStrategy($reflectClass)->getProperties() as $property) {
         $result->addElement(new ckXsdComplexTypeElement($property['name'], ckXsdType::get($property['type'])));
     }
     return $result;
 }
 /**
  * Creates a new array type object, if the given type name is one of an array type.
  *
  * @param string $name The name of an array type
  *
  * @return ckXsdArrayType The array type object
  */
 public static function create($name)
 {
     if (self::isArrayType($name)) {
         $elementTypeName = substr($name, 0, -strlen(self::ARRAY_SUFFIX));
         $elementType = ckXsdType::get($elementTypeName);
         if (!is_null($elementType)) {
             return new ckXsdArrayType(ckString::ucfirst($elementType->getName()) . self::NAME_SUFFIX, ckXsdNamespace::get('tns'), $elementType);
         }
     }
     return null;
 }
 public static function create($name)
 {
     $reflectClass = new ReflectionClass($name);
     $result = new ckXsdComplexType($name, ckXsdNamespace::get('tns'));
     foreach ($reflectClass->getProperties() as $property) {
         $type = ckDocBlockParser::parseProperty($property->getDocComment());
         if (!empty($type)) {
             $result->addElement(new ckXsdComplexTypeElement($property->getName(), ckXsdType::get($type['type'])));
         }
     }
     return $result;
 }