My soap server sends Content-Type: text/html in the response header. I need Content-type: text/xml.
public function index()
{
$this->layout = 'soap';
ini_set("soap.wsdl_cache_enabled", "0");
$this->server = new SoapServer('wsdl/tur.wsdl', array(
'soap_version' => SOAP_1_2,
));
$this->server->setObject($this);
$this->server->handle();
}
Here is server's response:
HTTP/1.1 200 OK
Date: Mon, 19 Mar 2012 12:17:10 GMT
Server: Apache/2.2.20 (Ubuntu)
X-Powered-By: PHP/5.3.6-13ubuntu3.6
Set-Cookie: CAKEPHP=msmid2fijgrj1efjs0otl8qfj1; expires=Mon, 19-Mar-2012 16:17:10 GMT; path=/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 877
Content-Type: text/html; charset=UTF-8
I've tried to call header() with text/xml conent type
public function index()
{
$this->layout = 'soap';
ini_set("soap.wsdl_cache_enabled", "0");
header("Content-Type: text/xml");
$this->server = new SoapServer('wsdl/tur.wsdl', array(
'soap_version' => SOAP_1_2,
));
$this->server->setObject($this);
$this->server->handle();
}
before and after constructing SoapServer, but no result.
SoapServer::addSoapHeaderdid you try that to override Content-Type? - armahandle, "...SoapServer::handle();method sends additional HTTP headers to the browser. One of them is 'Content-Type: application/soap+xml'." Not really an answer, but may provide some insight. - Travesty3