xref: /PHP-7.2/ext/soap/tests/server029.phpt (revision f1d7e3ca)
1--TEST--
2SOAP Server 29-CGI: new/addfunction/handle
3--POST--
4<?xml version="1.0" encoding="ISO-8859-1"?>
5<SOAP-ENV:Envelope
6  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
7  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
8  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
9  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10  xmlns:si="http://soapinterop.org/xsd">
11  <SOAP-ENV:Body>
12    <ns1:test xmlns:ns1="http://testuri.org" />
13  </SOAP-ENV:Body>
14</SOAP-ENV:Envelope>
15--SKIPIF--
16<?php
17	if (php_sapi_name()=='cli') echo 'skip';
18	require_once('skipif.inc');
19?>
20--FILE--
21<?php
22
23echo "INPUT: \n";
24echo file_get_contents("php://input") . "\n";
25echo "\n\n-----------\n\n";
26
27function test() {
28  return "Hello World";
29}
30
31$server = new soapserver(null,array('uri'=>"http://testuri.org"));
32$server->addfunction("test");
33$server->handle();
34echo "ok\n";
35?>
36--EXPECT--
37INPUT:
38<?xml version="1.0" encoding="ISO-8859-1"?>
39<SOAP-ENV:Envelope
40  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
41  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
42  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
43  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44  xmlns:si="http://soapinterop.org/xsd">
45  <SOAP-ENV:Body>
46    <ns1:test xmlns:ns1="http://testuri.org" />
47  </SOAP-ENV:Body>
48</SOAP-ENV:Envelope>
49
50
51-----------
52
53<?xml version="1.0" encoding="UTF-8"?>
54<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
55ok
56