From 470e719a8c543cd8ae447b4591a0ad472add754b Mon Sep 17 00:00:00 2001 From: Florian Thoma Date: Mon, 25 Apr 2016 12:46:48 +1000 Subject: [PATCH] fix response content type, fixes #3 --- changelog.md | 4 ++++ code/SapphireSoapServer.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4acc897..18b712d 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.0.1] + +* Fix response content type + ## [1.0.0] * Changelog added diff --git a/code/SapphireSoapServer.php b/code/SapphireSoapServer.php index b871c04..a520e72 100644 --- a/code/SapphireSoapServer.php +++ b/code/SapphireSoapServer.php @@ -32,7 +32,7 @@ class SapphireSoapServer extends Controller { ); function wsdl() { - $this->getResponse()->addHeader("Content-Type", "text/xml"); + $this->getResponse()->addHeader("Content-Type", "text/xml; charset=utf-8"); return array(); } @@ -93,6 +93,8 @@ function index() { $fh = fopen($wsdlFile, 'w'); fwrite($fh, $wsdl); fclose($fh); + + $this->getResponse()->addHeader("Content-Type", "text/xml; charset=utf-8"); $s = new SoapServer($wsdlFile, array('cache_wsdl' => WSDL_CACHE_NONE)); $s->setClass($this->class);