Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------
- server.php:
- ----------------------------------------------
- <?php
- class TestClass {
- public function importData($data)
- {
- $fd = fopen("testsoap.log", "a");
- fwrite($fd, var_export($data, true));
- fclose($fd);
- return array();
- }
- }
- $server = new SoapServer("test.wsdl");
- $server->setClass("TestClass");
- $server->handle();
- ----------------------------------------------
- client.php:
- ----------------------------------------------
- <?php
- for($i = 1; $i < 40000; $i++) {
- $data .= "+";
- }
- $obj = new stdClass();
- $obj->someVariable = $data;
- $client = new SoapClient("test.wsdl");
- $something = $client->importData($obj);
- var_dump($something);
- ----------------------------------------------
- WSDL:
- ----------------------------------------------
- <definitions name="importData"
- targetNamespace="http://some_url"
- xmlns:es="http://url_to/server.php"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- >
- <message name="importDataRequest">
- <part name="irgendwas" element="xsd:string"/>
- </message>
- <portType name="importDataPortType">
- <operation name="importData">
- <input message="es:importDataRequest"/>
- </operation>
- </portType>
- <binding name="importDataSoapBinding"
- type="es:importDataPortType">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="importData">
- <soap:operation
- soapAction="http://url_to/server.php"/>
- <input>
- <soap:body use="literal"
- namespace="http://some_url"/>
- </input>
- </operation>
- </binding>
- <service name="importDataService">
- <documentation>import Data</documentation>
- <port name="importDataPort"
- binding="es:importDataSoapBinding">
- <soap:address location="http://url_to/server.php"/>
- </port>
- </service>
- </definitions>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement