SOAP SERVER:
<?php function hello($name) { return "Hello ".$name." in soap server !"; } $server = new SoapServer("http://localhost/PHPSoapServer/soapServer.php", array('soap_version' => SOAP_1_2)); $server->addFunction("hello"); $server->handle(); ?>
WSDL
<?xml version="1.0"?> <definitions name="MyDefinition" targetNamespace="urn:myTargetNamespace" xmlns:tns="urn:myTns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="myRequest"> <part name="reqParam" type="xsd:string"/> </message> <message name="myResponse"> <part name="resParam" type="xsd:string"/> </message> <portType name="MyPortType"> <operation name="hello"> <input message="tns:myRequest"/> <output message="tns:myResponse"/> </operation> </portType> <binding name="MyBinding" type="tns:MyPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="hello"> <soap:operation soapAction=""/> <input> <soap:body use="encoded" namespace="urn:myInputNamespace" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:myOutputNamespace" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="MyService"> <documentation>Returns a greeting string. </documentation> <port name="MyPort" binding="tns:MyBinding"> <soap:address location="http://localhost/PHPSoapServer/soapServer.php"/> </port> </service> </definitions>
SOAP CLIENT
<?php $client = new SoapClient("http://localhost/PHPSoapServer/hello.wsdl");
po uruchomieniu soapClient.php localhost się zawiesza i musze restartować MAMP, co robię źle ?