私のSOAPサーバーは、応答ヘッダーにContent-Type:text/htmlを送信します。 Content-type:text/xmlが必要です。ここでSoapServerはtext/xmlの代わりにtext/htmlヘッダーを送信します。
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();
}
は、サーバーの応答です:
HTTP/1.1 200 OK
日:月、2012年3月19日12時17分10秒GMT
サーバー:Apacheの/ 2.2.20(Ubuntuの)
X-Powered-By:PHP/5.3.6-13ubuntu3.6
セットクッキー:CAKEPHP = msmid2fijgrj1efjs0otl8qfj1; expires = 2012年3月19日(月)16:17:10 GMT;パス=/
P3P:CP = "NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
は変更される場合:受け入れ-エンコーディング
コンテンツエンコード:gzipで
のContent-Length:877
のContent-Typeを:text/html;文字セット= UTF-8私はtext/xmlでのconentタイプ前とのSoapServerを構築した後
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();
}
、ない結果とヘッダを()を呼び出すことを試みてきました
。
のおかげで、こので働いたことはありませんが、documenationに 'のSoapServer :: addSoapHeader'あなたはContent-Typeのを上書きすることを試してみましたが?あり – arma
'handle'のための文書のコメントによると、" ... 'SoapServer :: handle();'メソッドはブラウザに追加のHTTPヘッダーを送ります。その1つは 'Content-Type:application/soap + xml' "本当に答えはありませんが、いくつかの洞察を提供するかもしれません。 – Travesty3