xref: /PHP-7.0/ext/soap/tests/server003.phpt (revision 9b661ea6)
1--TEST--
2SOAP Server 3: all functions
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7$server = new soapserver(null,array('uri'=>"http://testuri.org"));
8$server->addfunction(SOAP_FUNCTIONS_ALL);
9
10$HTTP_RAW_POST_DATA = <<<EOF
11<?xml version="1.0" encoding="ISO-8859-1"?>
12<SOAP-ENV:Envelope
13  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
14  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
15  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
16  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17  xmlns:si="http://soapinterop.org/xsd">
18  <SOAP-ENV:Body>
19    <ns1:strlen xmlns:ns1="http://testuri.org">
20      <x xsi:type="xsd:string">Hello World</x>
21    </ns1:strlen>
22  </SOAP-ENV:Body>
23</SOAP-ENV:Envelope>
24EOF;
25
26$server->handle($HTTP_RAW_POST_DATA);
27echo "ok\n";
28?>
29--EXPECT--
30<?xml version="1.0" encoding="UTF-8"?>
31<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:strlenResponse><return xsi:type="xsd:int">11</return></ns1:strlenResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
32ok
33