2013-10-15 11:46:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the BeSimpleSoap.
|
|
|
|
*
|
|
|
|
* (c) Christian Kerl <christian-kerl@web.de>
|
|
|
|
* (c) Francis Besset <francis.besset@gmail.com>
|
|
|
|
*
|
|
|
|
* This source file is subject to the MIT license that is bundled
|
|
|
|
* with this source code in the file LICENSE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace BeSimple\SoapCommon\Definition;
|
|
|
|
|
|
|
|
use BeSimple\SoapCommon\Definition\Type\TypeRepository;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Francis Besset <francis.besset@gmail.com>
|
|
|
|
*/
|
|
|
|
class Method
|
|
|
|
{
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
private $headers;
|
|
|
|
private $input;
|
|
|
|
private $output;
|
|
|
|
private $fault;
|
|
|
|
|
2013-12-08 00:23:30 +01:00
|
|
|
public function __construct($name)
|
2013-10-15 11:46:12 +02:00
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
|
2013-12-08 00:23:30 +01:00
|
|
|
$this->headers = new Message($name.'Header');
|
|
|
|
$this->input = new Message($name.'Request');
|
|
|
|
$this->output = new Message($name.'Response');
|
|
|
|
$this->fault = new Message($name.'Fault');
|
2013-10-15 11:46:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDefinition()
|
|
|
|
{
|
|
|
|
return $this->definition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getVersions()
|
|
|
|
{
|
|
|
|
return array(\SOAP_1_1, \SOAP_1_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUse()
|
|
|
|
{
|
|
|
|
return \SOAP_LITERAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addHeader($name, $type)
|
|
|
|
{
|
|
|
|
$this->headers->add($name, $type);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addInput($name, $type)
|
|
|
|
{
|
2019-02-11 12:22:13 +01:00
|
|
|
$inName = $this->name;
|
|
|
|
$this->input = new Message($inName);
|
|
|
|
|
2013-10-15 11:46:12 +02:00
|
|
|
$this->input->add($name, $type);
|
|
|
|
}
|
|
|
|
|
2019-02-11 12:22:13 +01:00
|
|
|
public function setOutput($type, $name = 'return')
|
2013-10-15 11:46:12 +02:00
|
|
|
{
|
2019-02-11 12:22:13 +01:00
|
|
|
if ('return' !== $name) {
|
|
|
|
$this->output = new Message($name);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->output->add($name, $type);
|
2013-10-15 11:46:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeaders()
|
|
|
|
{
|
|
|
|
return $this->headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getHeader($name, $default = null)
|
|
|
|
{
|
|
|
|
return $this->headers->get($name, $default);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getInput()
|
|
|
|
{
|
|
|
|
return $this->input;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOutput()
|
|
|
|
{
|
|
|
|
return $this->output;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFault()
|
|
|
|
{
|
|
|
|
return $this->fault;
|
|
|
|
}
|
|
|
|
}
|