xref: /PHP-5.3/ext/soap/tests/bugs/bug30994.phpt (revision 9b661ea6)
1--TEST--
2Bug #30994 (SOAP server unable to handle request with references)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7$HTTP_RAW_POST_DATA = <<<EOF
8<?xml version="1.0" encoding="utf-8"?>
9<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
10	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
11	xmlns:tns="http://spock/kunta/kunta"
12	xmlns:types="http://spock/kunta/kunta/encodedTypes"
13	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
15
16<soap:Body
17soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
18	<q1:bassCall xmlns:q1="http://spock/bass/types/kunta">
19		<system xsi:type="xsd:string">XXX</system>
20		<function xsi:type="xsd:string">TASKTEST</function>
21		<parameter href="#id1" />
22	</q1:bassCall>
23
24	<soapenc:Array id="id1" soapenc:arrayType="tns:Item[1]">
25		<Item href="#id2" />
26	</soapenc:Array>
27
28	<tns:Item id="id2" xsi:type="tns:Item">
29		<key xsi:type="xsd:string">ABCabc123</key>
30		<val xsi:type="xsd:string">123456</val>
31	</tns:Item>
32
33</soap:Body>
34</soap:Envelope>
35EOF;
36
37function bassCall() {
38  return "ok";
39}
40
41$x = new SoapServer(NULL, array("uri"=>"http://spock/kunta/kunta"));
42$x->addFunction("bassCall");
43$x->handle($HTTP_RAW_POST_DATA);
44?>
45--EXPECT--
46<?xml version="1.0" encoding="UTF-8"?>
47<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://spock/kunta/kunta" 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:bassCallResponse><return xsi:type="xsd:string">ok</return></ns1:bassCallResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
48