示例#1
0
 function testAddPortOperation()
 {
     $wsdl = new WSDL\WSDL('MyService', 'http://localhost/MyService.php');
     $portType = $wsdl->addPortType('myPortType');
     $wsdl->addPortOperation($portType, 'operation1');
     $wsdl->addPortOperation($portType, 'operation2', 'tns:operation2Request', 'tns:operation2Response');
     $wsdl->addPortOperation($portType, 'operation3', 'tns:operation3Request', 'tns:operation3Response', 'tns:operation3Fault');
     $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">' . '<operation name="operation1"/>' . '<operation name="operation2">' . '<input message="tns:operation2Request"/>' . '<output message="tns:operation2Response"/>' . '</operation>' . '<operation name="operation3">' . '<input message="tns:operation3Request"/>' . '<output message="tns:operation3Response"/>' . '<fault message="tns:operation3Fault"/>' . '</operation>' . '</portType>' . '</definitions>');
 }