Exemple #1
0
 function testAddSoapOperation()
 {
     $wsdl = new WSDL\WSDL('MyService', 'http://localhost/MyService.php');
     $wsdl->addPortType('myPortType');
     $binding = $wsdl->addBinding('MyServiceBinding', 'myPortType');
     $wsdl->addSoapOperation($binding, 'http://localhost/MyService.php#myOperation');
     $wsdl->addBindingOperation($binding, 'operation1');
     $wsdl->addBindingOperation($binding, 'operation2', array('use' => 'encoded', 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"), array('use' => 'encoded', 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"));
     $this->assertEquals($this->sanitizeWSDLXmlOutputForOsCompability($wsdl->toXml()), '<?xml version="1.0"?>' . '<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" ' . 'xmlns:tns="http://localhost/MyService.php" ' . 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' . 'xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" ' . 'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ' . 'name="MyService" targetNamespace="http://localhost/MyService.php">' . '<portType name="myPortType"/>' . '<binding name="MyServiceBinding" type="myPortType">' . '<soap:operation soapAction="http://localhost/MyService.php#myOperation"/>' . '<operation name="operation1"/>' . '<operation name="operation2">' . '<input>' . '<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>' . '</input>' . '<output>' . '<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>' . '</output>' . '</operation>' . '</binding>' . '</definitions>');
 }