コード例 #1
0
ファイル: server008.php プロジェクト: badlamer/hhvm
<?php

class Foo
{
    function Foo()
    {
    }
    function test()
    {
        return $this->str;
    }
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->setclass("Foo");
var_dump($server->getfunctions());
echo "ok\n";
コード例 #2
0
ファイル: server010.php プロジェクト: badlamer/hhvm
<?php

class foo
{
    private $sum = 0;
    function Sum($num)
    {
        return $this->sum += $num;
    }
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->setclass("foo");
$server->setpersistence(SOAP_PERSISTENCE_REQUEST);
ob_start();
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:Sum xmlns:ns1="http://testuri.org">
      <num xsi:type="xsd:int">5</num>
    </ns1:Sum>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
ob_clean();
コード例 #3
0
ファイル: bug36629.php プロジェクト: badlamer/hhvm
<?php

function test1()
{
    throw new SoapFault("Server", "test1");
}
function test2()
{
    return new SoapFault("Server", "test2");
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction(array("test1", "test2"));
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:test1 xmlns:ns1="http://testuri.org" />
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
コード例 #4
0
ファイル: server024.php プロジェクト: badlamer/hhvm
}
class TestHeader2 extends SoapHeader
{
    function __construct($data)
    {
        parent::__construct("http://testuri.org", "Test2", $data);
    }
}
function test()
{
    global $server;
    $server->addSoapHeader(new TestHeader1("Hello Header!"));
    $server->addSoapHeader(new TestHeader2("Hello Header!"));
    return "Hello Body!";
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction("test");
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:test xmlns:ns1="http://testuri.org"/>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
コード例 #5
0
ファイル: server007.php プロジェクト: badlamer/hhvm
<?php

function Add($x, $y)
{
    return $x + $y;
}
function Sub($x, $y)
{
    return $x - $y;
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction(array("Sub", "Add"));
var_dump($server->getfunctions());
echo "ok\n";
コード例 #6
0
ファイル: server026.php プロジェクト: badlamer/hhvm
<?php

class Foo
{
    function test()
    {
        return "Hello World";
    }
}
$foo = new Foo();
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->setObject($foo);
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:test xmlns:ns1="http://testuri.org" />
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
コード例 #7
0
ファイル: server015.php プロジェクト: badlamer/hhvm
<?php

function test()
{
    return "Hello World";
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction("test");
$envelope = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:test xmlns:ns1="http://testuri.org" />
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($envelope);
echo "ok\n";
コード例 #8
0
<?php

function Add($x, $y)
{
    return $x + $y;
}
$server = new soapserver(dirname(__FILE__) . "/test.wsdl");
ob_start();
$server->handle();
$wsdl = ob_get_contents();
ob_end_clean();
if ($wsdl == file_get_contents(dirname(__FILE__) . "/test.wsdl")) {
    echo "ok\n";
} else {
    echo "fail\n";
}
コード例 #9
0
ファイル: server005.php プロジェクト: badlamer/hhvm
<?php

class Foo
{
    function test()
    {
        return "Hello World";
    }
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->setclass("Foo");
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:test xmlns:ns1="http://testuri.org" />
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
コード例 #10
0
<?php

echo "INPUT: \n";
echo file_get_contents("php://input") . "\n";
echo "\n\n-----------\n\n";
function test()
{
    return "Hello World";
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction("test");
$server->handle();
echo "ok\n";
コード例 #11
0
ファイル: server004.php プロジェクト: badlamer/hhvm
<?php

function Add($x, $y)
{
    return $x + $y;
}
function Sub($x, $y)
{
    return $x - $y;
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction(array("Sub", "Add"));
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:Add xmlns:ns1="http://testuri.org">
      <x xsi:type="xsd:int">22</x>
      <y xsi:type="xsd:int">33</y>
    </ns1:Add>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
コード例 #12
0
ファイル: server003.php プロジェクト: badlamer/hhvm
<?php

$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction(SOAP_FUNCTIONS_ALL);
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:si="http://soapinterop.org/xsd">
  <SOAP-ENV:Body>
    <ns1:strlen xmlns:ns1="http://testuri.org">
      <x xsi:type="xsd:string">Hello World</x>
    </ns1:strlen>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
コード例 #13
0
<?php

function Add($x, $y)
{
    return $x + $y;
}
$server = new soapserver(null, array('uri' => "http://testuri.org"));
$server->addfunction("Add");
$server->handle();
echo "ok\n";