@ 2014-10-09T17:19:20Z <?php
$wsdl = <<<'WSDL'
<?xml version='1.0' encoding='UTF-8'?>
<definitions name="ab" targetNamespace="urn:ab" xmlns:typens="urn:ab" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ab">
<xsd:complexType name="A">
<xsd:sequence>
<xsd:element name="x" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Broken">
<xsd:sequence>
<xsd:element name="completelyBroken" type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="f">
<part name="fRequest" type="typens:A"/>
</message>
<message name="fResponse">
<part name="fRequest" type="typens:A"/>
</message>
<portType name="abServerPortType">
<operation name="f">
<input message="typens:f"/>
<output message="typens:fResponse"/>
</operation>
</portType>
<binding name="abServerBinding" type="typens:abServerPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="f">
<soap:operation soapAction="urn:abServerAction"/>
<input>
<soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:ab" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="abService">
<port name="abServerPort" binding="typens:abServerBinding">
<soap:address location="http://localhost/dummy"/>
</port>
</service>
</definitions>
WSDL;
file_put_contents('test.wsdl', $wsdl);
function f($a) {
return $a;
}
class LocalSoapClient extends SoapClient {
function __construct($wsdl, $options) {
parent::__construct($wsdl, $options);
$this->server = new SoapServer($wsdl, $options);
$this->server->addFunction("f");
}
function __doRequest($request, $location, $action, $version, $one_way = 0) {
ob_start();
$this->server->handle($request);
$response = ob_get_contents();
ob_end_clean();
return $response;
}
}
class Broken {
public $completelyBroken;
}
$client = new LocalSoapClient('test.wsdl',
array('classmap' => array('Broken' => 'Broken'))
);
$broken = new Broken();
$broken->completelyBroken = 'indeed it is';
print_r($client->f($broken));
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for git.master , git.master_jit , rfc.property-hooks Warning: file_put_contents(): open_basedir restriction in effect. File(test.wsdl) is not within the allowed path(s): (/tmp:/in:/etc) in /in/mqC71 on line 59
Warning: file_put_contents(test.wsdl): Failed to open stream: Operation not permitted in /in/mqC71 on line 59
Fatal error: Uncaught Error: Class "SoapClient" not found in /in/mqC71:65
Stack trace:
#0 {main}
thrown in /in/mqC71 on line 65
Process exited with code 255 . This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches Archived branches Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:dark mode live preview
64.9 ms | 401 KiB | 8 Q