Skip to content

Commit

Permalink
Make use of UTF-8 encoding in wsdl possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
baru authored and f3l1x committed Jan 2, 2024
1 parent 9ead68e commit def5d52
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3842,7 +3842,7 @@ function service($data)
}
} elseif ($this->wsdl) {
$this->debug("In service, serialize WSDL");
header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
header("Content-Type: text/xml; charset={$this->soap_defencoding}\r\n");
print $this->wsdl->serialize($this->debug_flag);
if ($this->debug_flag) {
$this->debug('wsdl:');
Expand All @@ -3851,15 +3851,15 @@ function service($data)
}
} else {
$this->debug("In service, there is no WSDL");
header("Content-Type: text/html; charset=ISO-8859-1\r\n");
header("Content-Type: text/html; charset={$this->soap_defencoding}\r\n");
print "This service does not provide WSDL";
}
} elseif ($this->wsdl) {
$this->debug("In service, return Web description");
print $this->wsdl->webDescription();
} else {
$this->debug("In service, no Web description");
header("Content-Type: text/html; charset=ISO-8859-1\r\n");
header("Content-Type: text/html; charset={$this->soap_defencoding}\r\n");
print "This service does not provide a Web description";
}
}
Expand Down Expand Up @@ -4692,6 +4692,7 @@ function configureWSDL($serviceName, $namespace = false, $endpoint = false, $sty

$this->wsdl = new wsdl;
$this->wsdl->serviceName = $serviceName;
$this->wsdl->soap_defencoding = $this->soap_defencoding;
$this->wsdl->endpoint = $endpoint;
$this->wsdl->namespaces['tns'] = $namespace;
$this->wsdl->namespaces['soap'] = 'http://schemas.xmlsoap.org/wsdl/soap/';
Expand Down Expand Up @@ -5642,7 +5643,7 @@ function popout(){ // Hides message
*/
function serialize($debug = 0)
{
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$xml = '<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>';
$xml .= "\n<definitions";
foreach ($this->namespaces as $k => $v) {
$xml .= " xmlns:$k=\"$v\"";
Expand Down

0 comments on commit def5d52

Please sign in to comment.