xref: /PHP-8.4/ext/soap/tests/server029.phpt (revision 7f2f0c00)
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--EXTENSIONS--
16soap
17--SKIPIF--
18<?php
19    if (php_sapi_name()=='cli') echo 'skip';
20?>
21--FILE--
22<?php
23
24echo "INPUT: \n";
25echo file_get_contents("php://input") . "\n";
26echo "\n\n-----------\n\n";
27
28function test() {
29  return "Hello World";
30}
31
32$server = new soapserver(null,array('uri'=>"http://testuri.org"));
33$server->addfunction("test");
34$server->handle();
35echo "ok\n";
36?>
37--EXPECT--
38INPUT:
39<?xml version="1.0" encoding="ISO-8859-1"?>
40<SOAP-ENV:Envelope
41  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
42  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
43  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
44  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
45  xmlns:si="http://soapinterop.org/xsd">
46  <SOAP-ENV:Body>
47    <ns1:test xmlns:ns1="http://testuri.org" />
48  </SOAP-ENV:Body>
49</SOAP-ENV:Envelope>
50
51
52-----------
53
54<?xml version="1.0" encoding="UTF-8"?>
55<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>
56ok
57