* '94-document-literal-wsdl' of https://github.com/nineinchnick/yii:
use consts in place of 'rpc' and 'encoded' for operationBodyStyle and bindingStyle properties
enh #94, added a wrapper in CWebService handling method arguments and response in document mode
enh #94, added support for document/literal WSDL in generator, inspired by Zend 2.0 Soap Autodiscover class
Fixed conflict with text/xml header.
Changed signature of CWsdlGenerator::buildHtmlDocs($return=false) to callable from other script. Also needed for unit test.
Fixes the following error:
Warning: DOMDocument::loadXML() [domdocument.loadxml]: xmlns:tns: 'some\namespaced\ClassName' is not a valid URI in Entity, line: 4 in \yii\framework\web\services\CWsdlGenerator.php on line 221
No unit test today, just a DumbErrorTest class:
<?php
class DumbErrorTest
{
public $serviceName;
public $namespace;
public function __construct()
{
$this->namespace = 'some\namespaced\ClassName';
$this->serviceName = $this->namespace;
$encoding = 'UTF-8';
$serviceUrl = 'dummy';
$this->buildDOM($serviceUrl,$encoding);
}
private function buildDOM($serviceUrl,$encoding)
{
$xml="<?xml version=\"1.0\" encoding=\"$encoding\"?>
<definitions name=\"{$this->serviceName}\" targetNamespace=\"{$this->namespace}\"
xmlns=\"http://schemas.xmlsoap.org/wsdl/\"
xmlns:tns=\"{$this->namespace}\"
xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\"
xmlns:soap-enc=\"http://schemas.xmlsoap.org/soap/encoding/\"></definitions>";
$dom=new DOMDocument();
$dom->loadXml($xml);
//more code...
}
}
new DumbErrorTest();